Hurt enemy through punch animation

Hello!

I am noob and in the midst of creating my first game. So my question is probably a very simple one, for all you pros; but hey. :stuck_out_tongue:

Okay so what I wan`t to do is have my character model do a punch animation and if it comes in contact with an enemy, destroy the enemy. If the character doesn’t do the punch animation and comes in contact with the enemy, the character gets hurt.

Would I wrap the fist in a collider that is set to destroy the enemy? If so how would a running animation work? If the player ran into the enemy wouldn’t the colliders on the fist just destroy the enemy?

Thanks and have a good day! :slight_smile:

This behaviour is not simple as say “Do this and this”.
But for begin… put a sphere collider in the punch, specify when you are punching (if key hit attak → punching, if punchAnimation end → not punching). Check the collision with the enemy (collider and rigidbody) and if collide and punch, kill. Else die.