Skip to content

Drag an object at arm's length

Updated

While the left button is held, CoordinateSpace.screenToWorld puts a lantern under the pointer, always three metres from the camera.

Hold the left mouse button and move the pointer: the lantern follows it, three metres away. Scroll to zoom.

Drag an object at arm's length

The script is explained step by step in Drag an object at arm’s length.

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.

DragLantern.xrproj