Networkable Trait
Updated
One thing its Networkable replicates to everyone in the room, and how often.
- Type
comp-networkable-trait- Script class
NetworkableTraitComponent- Per entity
- Several
- Version
- 1.0.0
Read about it in Multiplayer: what it does, how to use it from a script, and examples.
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A crate everyone can moveYour 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(NetworkableTraitComponent); if (component) log(component.props);}