Skip to content

Keep an orbit camera out of the walls

Updated

An orbit camera circles a statue inside a walled yard. Its Camera Collision sweeps from the statue to the camera, so when you orbit behind a wall the camera is pulled in front of it, and eases back out once clear.

Drag to orbit until a wall comes between you and the statue: the camera slides in front of the wall instead of behind it. The log reports how far it was pulled in.

Keep an orbit camera out of the walls

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.

CameraCollisionYard.xrproj