6
\$\begingroup\$

Imagine that I have an animation like this.

enter image description here

As you can see, this attack hits in three horizontal places. The opponent facing this player could be hit mid and low (standing or crouching).

The same goes for this move:

enter image description here

If the opponent is crouching, standing or in air it gets hit because the fire circle hits all areas (low, mid and high)

How can I handle hit detection with this sort of animation?

\$\endgroup\$
0

1 Answer 1

6
\$\begingroup\$

The way fighting games work is with attack and collision boxes per frame. This way there is not a high/mid/low hit per se, a high-kick could for example hit a jumping character.

In Street Fighter this looks like this:

Zangief hits Blanka in Street Fighter

The hit is scored if a red box hits a opponents blue box. Red being the attack box and blue hit boxes

In your example each frame of animation would define the red boxes, where a hit should be scored. In the 2nd animation- the flaming circle, you could remove hit boxes from that character rendering him invulnerable during that attack.

Sometimes there are additional block boxes, those nullify a hit. A character could for example be hit from the back but have a block up when hit from the front.

So: add hit and collision boxes to your anination information and check against those.

\$\endgroup\$
1
  • \$\begingroup\$ Well, i thought this would be a more complex thing but in terms of concept it's very simple. Thank you for your answer. \$\endgroup\$ Commented Jul 12, 2016 at 16:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .