Choose the enemy the player means when locking on
Lock-on picks the nearest enemy, but the player is looking at another one, or it flips back and forth between two enemies at the same distance. This entry weighs where the player points against how far away something is, and keeps the choice calm.
Why this works
Players aim with their eyes and their stick before they think of distance. Mixing how closely an enemy is lined up with how near it is picks the one they mean, and making a switch harder than staying keeps the choice from flickering.
When not to use it
Do not auto-pick in games where choosing the target is part of the challenge, such as shooters with many weak enemies, or when the camera is free. Let the player choose by hand, or lock on only on a button press.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 35 lines of example code with 3 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Choose the enemy the player means when locking on" (read_entry lock-on-target-choice) 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