🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

strategy for collision detecting of a melee attack

Started by
0 comments, last by gofresh 3 years, 10 months ago

Hi everyone,

I am currently having a problem that occurs when I try to detect collisions of an attack animation. I am using unity and have a 3d model. I added an empty game object to the models hand and attached a collision collider with istrigger checked. In the animation I ve created two events: OnBeginAttack and OnEndAttack. These events activated and deactivate the collider. I have another 3d model with a capsule collider. When I play the animation with empty hands (no weapon, just the a sphere collider as big as the models hand) I get the hit detection only on the left hand and not always. If the player is too close to the enemy, the hand goes through it and does not trigger collided event.

I have also tried another approach: I removed all the colliders and created OnHit animation event. When this event occurs, I create a sphere collider programmaticaly. This produced same results (sometimes even worse).

How do you guys handle this ? How do you setup melee attack system ? I have different types of weapons but also unarmed animations like boxing and kicking. I would appreciate any ideas.

This topic is closed to new replies.

Advertisement