Skip to content

A lamp anyone can switch

Updated

A point light shared with a Networkable and a point-light trait: the switch takes ownership with requestOwnership, then turns the light on or off for everyone.

Press Lamp Switch to turn the lamp off and on. In a published world the change reaches every peer.

A lamp anyone can switch

The script is explained step by step in A lamp anyone can switch.

Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.

SharedLamp.xrproj