Stop fast bullets from flying straight through small enemies
A very fast shot can be on one side of a small enemy in one frame and on the other side in the next, so it never counts as touching. This entry shows how to check the whole path of the shot each frame and how to know where along it the hit happened.
Why this works
Movement happens between two pictures, but the game only looks at the pictures. A fast shot can skip over a small body without ever standing on it. Checking the whole stretch it travelled, not just where it landed, closes the gap.
When not to use it
Skip it when shots are slow or targets are large, since the extra check changes nothing there. For very many bullets at once, such as a bullet storm, a cheap check of the end point with fatter targets may be enough.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 33 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 "Stop fast bullets from flying straight through small enemies" (read_entry fast-bullet-passes-through-thin-target) 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