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.

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.

Attach them to bones??