Spielerando

Let a pushed door swing, slow down by itself and stop at the frame without going through

A door that opens with a fixed animation feels the same whether you walk, run or are thrown against it, and one driven by a physics engine can wobble at its limit or fly through the wall. Here is a door that reacts to the push and always stops right.

Why this works

A real door has no spring; it keeps moving until rubbing slows it down. A hard push therefore carries further than a gentle one without any extra rule. Letting it bump softly at its end stops it from passing through the frame or the wall.

When not to use it

Don't use it for a door that closes by itself, such as a swing door or a gate with a spring, or for one that needs to be held open by a hand. Those need a pull back to a rest position.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 30 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 pushed door swing, slow down by itself and stop at the frame without going through" (read_entry pushed-door-swings-and-stops-at-the-frame) 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