Camera Orthographic
Updated
No perspective, for top-down, isometric and 2D views.
- Type
comp-camera-orthographic- Script class
OrthographicCameraComponent- Per entity
- One
- Version
- 2.0.0
Read about it in Cameras: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
far |
- |
|
near |
- |
|
size |
0. |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Zoom, pan and pick on a top-down mapAn Orthographic Camera looks straight down on a little town, with no perspective: the mouse wheel changes its size, the height of the view, the arrow keys move it across the map, and a click selects a house, shown with an animated outline.
Turn the mouse wheel over the map to zoom between 5 and 60 m of view height. Click a house to select it, then hold the arrow keys to move across the map.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(OrthographicCameraComponent); if (component) log(component.props);}