Skip to content

Follow Target

Updated

Follows an entity ID or name with a movement deadzone.

Type
comp-follow-target
Script class
FollowTargetComponent
Per entity
One
Version
3.0.0

Read about it in Follow target: 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
angleTolerance 0 ≤ x ≤ 3.141592653589793
offset.x
offset.y
offset.z
positionTolerance 0 ≤ x
rotationOffset.x
rotationOffset.y
rotationOffset.z
smoothTime 0 ≤ x

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