Skip to main content

SteeringSensor

Responds to the detections from input sensors to implement local avoidance detection.

Properties

IsSpherical

Steering Vectors are 3D when this is true and they are planar when this is false.

Resolution

Determines the number of discrete buckets that directions around the sensor are boken up into. See manual.

InterpolationSpeed

Speed that the sensor interpolates it's state. See manual.

Seek

Configurations the Seek target.

Interest

Configurations for the Interest behaviour.

Danger

Configurations for the Danger behaviour.

Velocity

Configurations for the Velocity behaviour.

Decision

Configurations for the Decision behaviour.

PulseMode

One of EachFrame, FixedInterval or Manual.

PulseInterval

If PulseMode is set to FixedInterval, this is the time in seconds between each pulse.

IsDestinationReached

Is true when we are within the desired range from the target seek position.

IsSeeking

Is true when we have not yet reached the destination.

LocomotionMode

See the manual. Enables the built-in locomotion if this is any value other then None.

Locomotion

The configurations for the built-in locomotion behaviours.

Methods

SeekTo(destination, distanceOffset)

void SeekTo(Transform destination, float distanceOffset = 0f)
void SeekTo(Vector3 destination, float distanceOffset = 0f)
Helper functions for configuring the Seek behaviour. Sets the Seek Mode to Position and sets the destination to either a Transform or Vector3. When distanceOffset is greater then 0 the agent will seek this distance away from the destination. The agent will not stop at the destination.

ArriveTo(destination, distanceOffset)

void ArriveTo(Transform destination, float distanceOffset = 0f)
void ArriveTo(Vector3 destination, float distanceOffset = 0f)
Helper functions for configuring the Seek behaviour. Same as SeekTo except the agent will stop at the destination.

SeekDirection(direction)

void SeekDirection(Vector3 direction)
Helper function for configuring the Seek behaviour. Sets the Seek Mode to Direction and assigns the target direction.

Wander()

void Wander()
Helper function for configuring the Seek behaviour. Sets the Seek Mode to Wander.

Stop()

void Stop()
Helper function for configuring the Seek behaviour. Sets the Seek Mode to Stop.

GetSteeringVector()

Vector3 GetSteeringVector()
Returns a velocity vector chosen by the sensor to be ideal.

GetSpeedCandidate(direction)

float GetSpeedCandidate(Vector3 direction)
For a given direction this will return a speed candidate calculated by the Velocity behaviour. It chooses between the lower and upper speed candidates by whichever is closest to the preferred speed.