Skip to content

Configure shadows when the scene starts

Updated

At startup a script switches on a lamp’s shadow map, lets a crate receive shadows and gives the floor a soft contact shadow: Light Shadow, Shadow and Contact Shadow components set from a Behavior script.

Orbit around to see the lamp's shadows and the soft contact shadows under each object. Drag to orbit the camera, scroll to zoom.

Configure shadows when the scene starts

The script is explained step by step in Configure shadows when the scene starts.

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.

ShadowSetup.xrproj