Steering behaviors
Seek, flee and arrive with smooth, natural turns.
Setting an enemy's velocity straight at a target makes it snap and jitter. Steering behaviours compute a desired velocity and push the current velocity toward it with a limited force, so agents curve, slow down as they arrive, and can blend several goals like seek plus avoid.
Try this: Move the target with the mouse in Seek mode: the agent overshoots and orbits. Switch to Arrive (3): it slows down and stops.
Move the pointer over the scene.
Prompt bit
Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.
Use steering behaviours for agents: desired velocity points at or away from the target, steering force = desired minus current velocity clamped to a max force, arrive slows inside a radius so the agent stops in about 0.5 s, and never divide by zero distance.
Implement steering behaviours (Craig Reynolds) for moving agents (2D or 3D, any engine; Unity and Godot nav agents provide avoidance, but these are for custom movement). Each agent has position, velocity, maxSpeed and maxForce. Seek: desired = normalize(target - position) * maxSpeed; steering = desired - velocity, clamped to maxForce; velocity += steering * dt, clamped to maxSpeed. Flee: the same with the direction reversed, only within a panic radius. Arrive: like seek, but inside a slowing radius scale desired speed by distance / slowingRadius so the agent stops at the target. Add wander (a jittered target on a circle ahead) and obstacle avoidance (a feeler ray). Combine behaviours with weights (for example seek 1, separation 1.5, avoid 2) and clamp the total. Guard against zero-length vectors. Rotate the sprite or model to face the velocity smoothly.
Where it's used
- Action games: enemies that chase and circle naturally
- Racing games: AI cars following a racing line
- Flocking: birds, fish and crowds
- Space games: ships pursuing and evading
- Pets and companions: following without bumping into you
Common mistakes
Setting velocity directly so agents snap, seek without arrive so agents orbit the target forever, unclamped forces that make agents twitchy, and normalizing zero vectors when the agent is exactly on the target.
Writing this with an AI assistant? See our best AI coding assistants for game developers.
Missing a concept? Request one.



