# How to make a collider the follows all the animations of a prefab?

I have attached a capsule collider with my player(prefab) and made a script so that when Space key is down it does the jump animation in Unity. But because of the collider not jumping with the player, the player gets stopped by obstacles though he visually passed it. How can I make a collider that moves with my animations attached to a prefab?

• Can you show us what your jump animation looks like? If it's a skeletal animation, you may be able to simply attach the collider to the character's hip bone or similar. For more complex cases, you might need to adjust the collider's size and offset or enabled state through animation curves. Oct 6 '19 at 12:21

## 1 Answer

You can move the collider's transform but not with animation. To animate the collider, you can make a child object and assign collider component to that child object, then you can make an animation that moves the collider child object with aniamtion.

Otherwise you can disable APPLY ROOT MOTION from your animator component and let physics move it by AddForce()