Skip to content

Tap to place on a phone

Updated

On an AR phone, a tap on the floor drops an anchored copy of a hidden plant there: XRRaycaster.fromScreen finds the surface, spawn copies the plant and anchorAt ties it to the spot.

This one needs AR: open the page on an AR phone. On a desktop there is no real surface to hit, so nothing is placed.

Tap to place on a phone

The script is explained step by step in Tap to place on a phone.

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.

TapToPlace.xrproj