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.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
mass |
0. |
|
maxForce |
0 ≤ x ≤ 1000 |
|
speed |
0 ≤ x ≤ 1000 |
|
viewAngle |
1 ≤ x ≤ 360 |
|
viewDistance |
0 ≤ x ≤ 10000 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
SteeringAgent::arrive
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
A script turns three landmarks into a Steering Follow Path for a courier; at the last stop the Steering Agent sends arrive, and the round starts again five seconds later.
Watch the amber courier visit the bakery, the fountain and the library in order; at the library the log reports the round, and the next one starts after five seconds. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(SteeringAgentComponent); if (component) log(component.props);}