Choose which of several nearby items the interact button picks up
A table with a key, a letter and a candle on it asks the player to press one button and get the thing they meant. This entry picks the target from distance and the way the player is facing, and keeps the choice from flicking back and forth when two items are about equally good.
Why this works
People point with their body before they press. Weighing how close something is together with how directly the player faces it matches what they meant, and holding on to the current choice for a moment stops the prompt flickering when two things are nearly equal.
When not to use it
Skip it when only a few things can ever be near, or when the player picks with a pointer or finger. Then touching the thing is the choice itself. Also skip it for tightly packed puzzle tables, where a visible cycling list is clearer.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 30 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 "Choose which of several nearby items the interact button picks up" (read_entry pick-the-right-pickup-when-items-overlap) 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