Cut the rope
Updated
A chandelier swings from a fixed hook on a Rope Joint; pressing the button raises cut and the script disables the joint, so the chandelier falls.
Press Cut the rope. Drag to orbit the camera, scroll to zoom.
Cut the rope
#pragma lifecycle(startup)
function startup() { const rope = findEntity('Chandelier').getComponent(PhysicsRopeJointComponent); on('cut', () => { rope.setEnabled(false); log('The rope snaps'); });}How it works
Section titled “How it works”The script is explained step by step in Cut the rope.
Open it in XR Creator
Section titled “Open it in XR Creator”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.
CutTheRope.xrproj