Skip to content

Steering Agent

Updated

The AI brain of a character: it sums the steering behaviors on its entity.

Type
comp-steering-agent
Script class
SteeringAgentComponent
Per entity
One
Version
2.0.0

Read about it in Steering: 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
mass 0.001 ≤ x ≤ 1000
maxForce 0 ≤ x ≤ 1000
speed 0 ≤ x ≤ 1000
viewAngle 1 ≤ x ≤ 360
viewDistance 0 ≤ x ≤ 10000

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • SteeringAgent::arrive

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