Pressing "talk" picks the wrong person when two things stand close together
A shop counter, a chest and a villager can all be within reach at once. Picking the nearest looks right until the highlight starts flickering between two while you walk. Here is how to rank what you are facing, and how to make the choice stay put unless something is clearly better.
Why this works
People mean what is in front of them and near, not just what is nearest. Mixing distance with where the hero looks picks the thing they mean, and asking a challenger to be clearly better stops the choice from flipping at every tiny step.
When not to use it
Skip the scoring when there is only ever one thing in reach, or when the player points at things with a mouse or finger. Then the thing under the pointer is the target and no guessing is needed.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 42 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 "Pressing "talk" picks the wrong person when two things stand close together" (read_entry rpg-interact-target-with-hysteresis) 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