A fast attack or bullet flies right through a small enemy without hitting
Checking where the weapon is at each frame misses everything it passes between two frames. The faster the attack, the more hits vanish, and it depends on the computer. Here is the check that finds the first point of contact along the whole path.
Why this works
A fast object does not jump from place to place; it travels the whole way between two pictures. Checking the line it covers, not just where it ends, finds the first thing in its path, so speed and thinness can no longer let a hit slip through.
When not to use it
Not needed for slow movers or big targets, where checking the end point already works. For bullets that are meant to be dodged or may skip things, such as a playful scatter shot, a simple end-point check is cheaper and good enough.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 34 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 "A fast attack or bullet flies right through a small enemy without hitting" (read_entry fast-swing-passes-through-thin-enemy) 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