Networkable
Updated
Shares the entity with everyone in the room.
- Type
comp-networkable- Script class
NetworkableComponent- Per entity
- One
- Version
- 2.1.0
Read about it in Multiplayer: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
idle |
0 ≤ x ≤ 2592000 |
|
ttl |
0 ≤ x ≤ 2592000 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
Networkable::ownership-changeNetworkable::connectNetworkable::disconnectNetworkable::errorNetworkable::peer-joinNetworkable::peer-leave
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Your first shared object: a grabbable crate with a Networkable and transform and material traits; whoever takes it gives it a new colour for everyone.
Drag the crate. The preview has no Arena room, so the log says you are playing alone; in a published world, open it in two tabs to see the crate move and change colour in both.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(NetworkableComponent); if (component) log(component.props);}