Rigidbody2D/Animation makes gameobject float

Hi guys,

I have been trying to develop a 2D platformer game, but I have encountered my first problem really soon.
As soon as I add rigidbody2D and animation to my protagonist gameobject, it starts to float in the air.
I tried to add exactly same components(rigidbody, collider, script) on a single sprite(no animation), the problem won’t occur.
Then I tried to take out only rigidbody2D on the original protagonist, and the character plays the idle animation and won’t float.
This problem only occurs when both animation and rigidbody2D are added to the gameobject.
Changing the mass or gravity solves it, but I am really curious why is this happening.
Any feedback will be appreciated.

Hi,

I had the same issue when i started to play with 2D. To resolve this just uncheck “Apply Root Motion” in Animator.

Thanks a lot!!
It does solve the problem, time to study root motion I guess.

Hello,

I’m having the same issue here. I’ve unchecked the “Apply Root Motion” but the problem still happens.

You can disable the animator by default and only enable it when you actually use the animations.