Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/520653190518169600
Some grammar. Changed occurrences of "what is the best way" to "how should I", because there is never a One Best Way to implement this, only what's best for you.
Source Link
Anko
  • 13.4k
  • 10
  • 55
  • 82

Melee How do I implement melee hit boxes for a top-down game?

For a 3D top-down game, what is the best way to handhow should I handle collision in melee combat? There isMy game has 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 toHow should I handle this?

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

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.

How do I implement melee hit boxes for a top-down game?

For a 3D top-down game, how should I handle collision in melee combat? My game has no targeting system, 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. How should I handle this?

Also, I would like to use the same attack script for all players and NPCs in melee, even with different attack animations and hit boxes. However, really I can't figure out how to reliably assign who the attacker and who the target are within that script, or how to handle multiple simultaneous attacks.

Source Link
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.