Skip to content

Orbit Controller

Updated

Drag to orbit, wheel to zoom around a point or entity.

Type
comp-orbit-controller
Script class
OrbitControllerComponent
Per entity
One
Version
2.0.0

Read about it in Camera controllers: what it does, how to use it from a script, and examples.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
distance 0 ≤ x ≤ 10000
distanceRange 0 ≤ x ≤ 10000
moveSpeed 0 ≤ x ≤ 50
pitchLimit 0 ≤ x ≤ 89
rotateSpeed 0 ≤ x ≤ 1
smoothTime 0 ≤ x ≤ 0.5
target

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(OrbitControllerComponent);
if (component) log(component.props);
}