Skip to content

Line of sight through glass

Updated

A guard’s sight ray tests only the Default and Walls layers, so it is blocked by the wall but sees through the window on the Glass layer; an Enable On Signal shows when it spots the player.

Drag the blue player behind the grey wall to hide it, or behind the glass, where the guard still sees it and the pink alarm lights. Drag elsewhere to orbit the camera.

Line of sight through glass

The script is explained step by step in Line of sight through glass.

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.

GlassSight.xrproj