Skip to content

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.

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

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • Networkable::ownership-change
  • Networkable::connect
  • Networkable::disconnect
  • Networkable::error
  • Networkable::peer-join
  • Networkable::peer-leave

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(NetworkableComponent);
if (component) log(component.props);
}