playMaker

Author Topic: How do I handle Blocking and Combos in a 2d Fighter?  (Read 1927 times)

G-Kaiser

  • Playmaker Newbie
  • *
  • Posts: 34
How do I handle Blocking and Combos in a 2d Fighter?
« on: March 24, 2015, 06:04:27 PM »
Hello all,

I am looking for some help with blocking attacks and doing combos for a 2d fighter I am currently developing. I would like to know how others have overcome this challenge or if someone can tell me about a tutorial detailing this. Any help is appreciated even if it is just the best way to approach it, I am not necessarily looking for a step by step. Although that would help a lot.

Thanks in advance

KellyRay

  • Full Member
  • ***
  • Posts: 170
Re: How do I handle Blocking and Combos in a 2d Fighter?
« Reply #1 on: March 24, 2015, 06:48:28 PM »
There are always hundreds of ways to do stuff. And if someone has a better approach, please do tell.

I would use a combination of, empty game objects parented to my character with triggers and the "set property" action targeting the enabling and disabling of the triggers.

For example, when I play my attacking animation, I also turn on the gameobjects that has my attack trigger, and then off again once the attack is done. All of my enemies are checking for a trigger with the tag "attack" on it so that when my fist or sword or whatever intersects they know they are hit.

Depending on how you are animating the fighter, you could do this directly using Unity's animation tools. Its just another keyframe inside the animation.

The theory would work with blocking as well. When ever the blocking animation is playing, I turn on my blocking trigger so that I know I am blocking instead of being attacked.