Skip to content

Third Person Controller

Updated

Camera orbiting behind a target character.

Type
comp-third-person-controller
Script class
ThirdPersonControllerComponent
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
lookHeight -20 ≤ x ≤ 20
lookSpeed 0 ≤ x ≤ 1
pitch -89 ≤ x ≤ 89
pitchLimit 0 ≤ x ≤ 89
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(ThirdPersonControllerComponent);
if (component) log(component.props);
}