HOW TO Manage Hitbox For Weapon Activating During Animation (Great Detail Inside)

Hi, I am making an 3D action game and am tackled with the task of creating good combat like Monster Hunter or Dark Souls.

I already have the animations and am pretty sure I’ll keep using colliders unless someone points me to an super efficitve way while staying as flexible as colliders are.


  • The problem at hand with an example:

“Attack_Animation_1” (“AA1”) of “Player_1” is called who holds “Sword_1” (“S1”) in his right hand.

“S1” has multiple collideres as hitboxes attached that now have to be activated or deactivated, also colliders specifically for “AA1”. Depending of the frame of “AA1”.

  • The actual problem:

Now I need to communicate through “AA1”'s Animation component which colliders of S1 have to activate/deactivate.
Meaning a communication(class/script?) between “AA1” and “S1” has to happen.

After that I have to be able to swap S1 with Sword_2 which then has to use the same hitboxes when AA1 is played

This is what I imagine a HitboxManagerClass could handle. I have no idea where to start, though.

Can you help me to find a soloution to the problem? How can I make “AA1” and “S1” communicate and call reactions from the enemy in a timely manner?

TL;DR:

  • How to manage hitboxes of weapons during animations of the character wielding the weapon

  • Hurtboxes of enemies and

  • How to trigger behavior and other animations like subtracting HP and stunning.

  • How to make the weapon interchangable and keep functionality

  • Need guide of some sort

My game will be weapon/sword centric and so I need to manage hitboxes on different kind of weapon animations fast and accurately to generate a good player feedback.

Any good source of help would be great!

Thanks in advance!

One way is to activate/deactivate colliders directly from animation.

How to do it:

  • Click on Sword Object (Which has
    diiferent HitBoxes as children).

52460-1.png

  • Create new clip. Call it
    “Attack_Animation_1”.
  • On 1st frame click: Add Property >
    arrow of hitbox which u want to edit plus sign of IsActive. To add that property inside animation.

52461-2.png

  • Add properties in successive frames. As suggested above.