28 · AI · 2D and 3D

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.

123 seek, flee, arriveTap or drag to move the target

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.

45 words · one sentence to paste as is

Where it's used

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.

Related concepts

New concepts, in your inbox.

One short email when we add new concepts, plus our weekly roundup of AI tools for game devs. Unsubscribe any time.