Make a snake body or tail follow the head without stretching or cutting corners
Moving each segment toward the one in front with a smooth chase lets the chain stretch when the head is fast and bunch up when it is slow. Segments that copy the head's old positions by time cut corners at different speeds. Here is a simple rule that keeps the spacing fixed.
Why this works
If each piece is placed at exactly its fixed distance from the one ahead, spacing cannot drift, whatever the speed or frame rate. Keeping the direction it already had means the body trails behind the head like a rope, rather than copying its past route.
When not to use it
Wrong when the body must walk exactly the head's route, as a train on tracks or a snake in a maze with narrow turns: it cuts corners. Record the head's path and place segments along that trail instead.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 33 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Make a snake body or tail follow the head without stretching or cutting corners" (read_entry snake-or-tail-follows-the-head-in-its-path) 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