@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 ​
| Parameter | Type |
|---|---|
options | XRMultiplayerOptions |
Returns ​
XRMultiplayerComponent
Overrides ​
Properties ​
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
avatarStyle | XRAvatarStyle | "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 |
headPrefab | string | "" | A .prefab to draw as each player's head, instead of the default one. | components/Network.ts:138 |
leftHandPrefab | string | "" | - | components/Network.ts:139 |
rightHandPrefab | string | "" | - | components/Network.ts:140 |
sendRate | number | 20 | Head and hand updates per second each player sends. | components/Network.ts:142 |
interpolationMs | number | 120 | How far in the past others are drawn, in ms. More is smoother. | components/Network.ts:144 |
shareHandJoints | boolean | true | Send tracked fingers too (about 6 KB/s more per player), not just the wrist. | components/Network.ts:146 |
nameTags | boolean | true | A name above each player's head. | components/Network.ts:148 |
colocation | boolean | false | Players in one room share it: each touches the same two real points to line up. | components/Network.ts:150 |
calibrateOnStart | boolean | true | Ask for the two points when a mixed reality session starts. | components/Network.ts:152 |
minPointDistance | number | 0.3 | The two points must be at least this far apart (m) for a steady heading. | components/Network.ts:154 |

