Steering Evade
Updated
Flee from where the target is going to be.
- Type
comp-steering-evade- Script class
SteeringEvadeComponent- Per entity
- Several
- Version
- 1.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 |
|---|---|---|
lead |
0 ≤ x ≤ 10 |
|
panicDistance |
0 ≤ x ≤ 1000 |
|
weight |
0 ≤ x ≤ 10 |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Cat and miceAn amber cat with a Steering Pursue chases the nearest of four mice, cutting them off, while each mouse uses a Steering Evade to dodge where the cat is heading.
Watch the cat cut the mice off and the mice veer away once it comes within 3 m; the label names its current prey. 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(SteeringEvadeComponent); if (component) log(component.props);}