best way to cost damage to the player

manscom

Member
hi , what is the best way to cost damage to the playerr?

i have an zombie enemy and he uses a his hand to attack the player, for that i just attached a capsule trigger on his hand to detect if the hit object has the CharacterHealth.cs component , if yes then just called Damage() function to cost damage, but the trigger detection seem to catching multiple objects on the player, so it damage the player at least twice on every single hit
so what is the best way to do this?

Thank you!
MansCom
 
problem solved.

I used a function called Physics.OverlapSphere(), on my case, i am using the animation event to cost the damage at a specific frame, this function can be trigger very accurate
 
Top