How to set the Flee Steering Behavior
The Flee Steering Behavior has the opposite behavior as the Seek Steering Behavior. That is, instead of approaching the Target Position, it moves away from the Target Position.
The code snippet below shows how to compute the Flee Steering velocity.
Line 1 shows the creation of the Flee instance object. The Flee behavior requires a target position. This position is provided in line 2. Assuming you have created an instance of your character, you can then compute the Final Velocity as shown in line 3.
PreviousHow to enable the Pursuit Steering BehaviorNextHow to enable the Avoidance Collision Steering Behavior
Last updated