How to detect collision of an animating character?
Hi everyone,
I am making a football game in Unity. It has many charcters and each character plays several animations like jumping, hitting ball through leg, and even the goal keeper has to do many things to prevent goals. For all these we have animated the character model.
The problem is how can I or the game AI know whether the ball is collided with which part of a body (ex. legs, head, stomach, hands etc.,) and even collision between two characters.
Please share your ideas or suggestions if you know.
Answer by MaT227 · Sep 19, 2013 at 08:30 AM
I think that you need to divide the body in multiple parts like arms, feet, torso etc... And for each of them you attach a box collider with maybe a different layer or tag. And of course a box collider on the ball (I say box collider but you can use whatever you want).
You can attach those collider on you body part and scale them.
With this you will have each part of your body. A bit like this.
Thanks for your answer. But I did added colliders for different parts. But it is suitable only if the character is standing or in idle state. If the character is perfor$$anonymous$$g som actions like jumping, hitting the ball through legs or hands then it will not suit.
If you've any solution these kind of situations please let me know
I also face that issue. When body parts are moving ,colliders don't move with parts. What is the correct way
Your answer
![](https://koobas.hobune.stream/wayback/20220613114443im_/https://answers.unity.com/themes/thub/images/avi.jpg)