Main Camera
Updated
Makes this camera its scene’s player view. One per scene; a second one waits and takes over when the first goes.
- Type
comp-main-camera- Script class
MainCameraComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Cameras: what it does, how to use it from a script, and examples.
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Click and grabA Selectable that reports clicks and hovers, and a Grabbable you can drag with a mouse, a touch screen or an XR controller. A script listens to both on the event bus.
Hover and click the round shape on the left, then drag the box on the right. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(MainCameraComponent); if (component) log(component.props);}