Circling an enemy drifts outward in a spiral instead of keeping the distance
With a locked-on enemy, sideways movement should walk around it like a circle. Moving in a straight sideways line quietly moves away every frame, until the hero is across the room. Here is how to turn that into an arc, and how forward and back change the circle's size.
Why this works
Walking around something means staying the same distance from it, so the move must be described as turning around it, not as a step to the side. A step to the side always ends farther away, and the error grows every moment.
When not to use it
Skip it when the lock is only a soft aim help and the player is meant to move freely, or in a game where enemies are huge and the hero must run along their body. Then keep the normal controls and only turn the view.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 25 lines of example code with 6 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Circling an enemy drifts outward in a spiral instead of keeping the distance" (read_entry rpg-strafe-around-locked-target) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP