If PresetVelocity
is set to anything other than None
, the agent uses a specified forward direction for its movement velocity. For example, an agent moving in the x/y-plane should probably use (0,1,0) as default direction which is given by the Vector3.up
in Unity, as against an agent moving in the x/z-plane should probably use Vector3.forward
. This can be very useful since it guarantees the presence of a valid velocity vector within the corresponding SteeringPercept
, even if no valid source like a rigidbody or an Steering Tag with an active VelocityTracking
is present in the scene.
The following options are available for pre-setting a velocity vector.
Value | Description |
---|---|
None | This feature is not active. |
Automatic | The system deduces the vector itself based on the sensor setup. For 2D scenarios (x/y-plane), a value of (0,1,0) is used. Otherwise, (0,0,1). |
Up | The vector (0,1,0) is used. |
Down | The vector (0,-1,0) is used. |
Forward | The vector (0,0,1) is used. |
Back | The vector (0,0,-1) is used. |
Left | The vector (-1,0,0) is used. |
Right | The vector (1,0,0) is used. |
Note that choosing a source for obtaining velocity values strongly influences the effect of the prediction mechanism for all steering behaviours. Since TrackVelocity
ignores the actual alignment of the agent, it is suitable for scenarios where the agent can move independently from its looking direction, e.g. a tank. As against using a preset velocity perfectly fits for agents that move more directly like birds in a flock.