Let a door open for arrivals, stay open for a whole queue, and close after the last
A door that opens and closes for every single person makes a busy barracks look like a nervous machine, and a door that closes on someone standing in the doorway cuts them in half. This entry gives a door with a delay before closing and a rule about who may pass and when, so queues flow and nobody is caught.
Why this works
A door is there for people, so it should react to what people need: open when someone is coming, stay while someone is in it, and close only after a short pause. That pause is what stops it flapping between two people who follow each other.
When not to use it
Wrong for doors the player is meant to control, such as locked gates, a drawbridge or a vault that opens only with a key or a lever. There the door follows the player's choice, not the traffic.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 29 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Let a door open for arrivals, stay open for a whole queue, and close after the last" (read_entry door-stays-open-for-a-queue-and-closes-after-the-last-person) 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