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?
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