Skip to main content
1 of 2
Gaxx
  • 11
  • 2

Melee hit boxes

For a 3D top-down game, what is the best way to hand collision in melee combat? There is no targeting system in my game, so I can't use a simple distance check between attacker and target.

What I am thinking is have the character swing, generate a hit box, run the damage script for any characters in that hit box, and then delete the hit box. What is the best way to handle this?

Also, I would like to use the same attack script for all players and NPCs in melee, even with different attack animations & hit boxes. But another really basic concept I can't seem to figure out is reliably assign who the attacker and who the target are within that script, or how to handle multiple attacks happening at the same time.

Gaxx
  • 11
  • 2