A companion who cuts corners and gets stuck in doorways behind me
A helper that walks straight toward you gets caught on walls the moment you turn a corner. If it instead walks along the line you actually took, it is never in a place you were not. Here is how to store that line without storing every footstep, and how to find the spot a given distance behind you.
Why this works
A follower looks alive when it goes where you actually went, since your path already shows what is walkable. Following your trail instead of aiming straight at you means it uses the doors and corners you used, without any path finding of its own.
When not to use it
It fails when you can move without walking, by teleporting, flying or being pulled, because your trail then crosses walls. Then give the follower its own way of finding a route, or let it appear next to you.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 31 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 "A companion who cuts corners and gets stuck in doorways behind me" (read_entry coop-companion-follows-the-path-you-walked) 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