Skip to content

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.

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(MainCameraComponent);
if (component) log(component.props);
}