How to enable the Seek Steering Behavior
The Seek steering behavior returns a Final Velocity that directs an agent towards a target position. The AI system takes into account the Current Velocity of the agent when computing the final velocity.
The code snippet below shows how to compute the Seek Steering velocity.
To use the Seek Behavior you must create an instance of the behavior as shown in line 1. Next, you must specify a target position for the agent to approach as shown in line 2. Assuming that you have created an instance of your character, you can then compute the Final Velocity as shown in line 3.
The getSteering() method takes as a parameter the instance of the character and a target position.
The clip below shows the behavior of the Red agent approaching the Astronaut agent using the Seek Steering behavior.
Last updated