Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / components / XRMultiplayerComponent

Class: XRMultiplayerComponent ​

Defined in: components/Network.ts:131

Multiplayer in VR and mixed reality. Each player's head and hands are shared and drawn for the others, and with colocation on, players in the same room line up their headsets by touching the same two real points. Put it on the XR Rig. Without it, an XR project with multiplayer still shares heads and hands with these defaults.

Extends ​

Constructors ​

Constructor ​

ts
new XRMultiplayerComponent(options?): XRMultiplayerComponent;

Defined in: components/Network.ts:156

Parameters ​

ParameterType
optionsXRMultiplayerOptions

Returns ​

XRMultiplayerComponent

Overrides ​

Component.constructor

Properties ​

PropertyTypeDefault valueDescriptionDefined in
avatarStyleXRAvatarStyle"auto"How other players look. auto is a full head and hands in VR and a subtle outline in passthrough, where you already see the real person.components/Network.ts:136
headPrefabstring""A .prefab to draw as each player's head, instead of the default one.components/Network.ts:138
leftHandPrefabstring""-components/Network.ts:139
rightHandPrefabstring""-components/Network.ts:140
sendRatenumber20Head and hand updates per second each player sends.components/Network.ts:142
interpolationMsnumber120How far in the past others are drawn, in ms. More is smoother.components/Network.ts:144
shareHandJointsbooleantrueSend tracked fingers too (about 6 KB/s more per player), not just the wrist.components/Network.ts:146
nameTagsbooleantrueA name above each player's head.components/Network.ts:148
colocationbooleanfalsePlayers in one room share it: each touches the same two real points to line up.components/Network.ts:150
calibrateOnStartbooleantrueAsk for the two points when a mixed reality session starts.components/Network.ts:152
minPointDistancenumber0.3The two points must be at least this far apart (m) for a steady heading.components/Network.ts:154