Make a piercing shot or sword swing hurt each enemy once, not every frame
A shot that passes through an enemy touches it for many frames in a row, so the enemy melts in an instant, and a sword swing does the same. This entry keeps a short memory of who an attack has already hurt, and lets you choose whether it may hurt again after a while.
Why this works
Touching lasts for many frames, but a hit is a single event. By writing down who was hurt by which attack, and when, each pairing can be settled once, while different attacks on the same enemy still count separately, as they should.
When not to use it
Skip it when the attack is meant to hurt continuously, such as a beam or a poison cloud that drains health every moment. Use a steady damage rate over time there, or a re-hit delay, instead of a single hit.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 18 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 "Make a piercing shot or sword swing hurt each enemy once, not every frame" (read_entry action-piercing-shot-hits-once) 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