[Solved] Root Motion with Rigidbody and gravity

Hello,
I made a simple walkcycle with root motion. So the forward movement is completely controlled by the animation (Y root transform was baked into the pose). At this point everything seemed to work normally. When I tried adding a rigidbody and a collider, it moved at the same speed, but activating gravity slows the character down considerably. Now the animation looks bad and the character moves really slow. Making it kinematic fixes the problem, but then the character of course ceases to properly interact with other rigidbodies.
So my question is basically how do I fix this. Why is gravity slowing down the animated walkspeed?
Importing the armature as Generic or Humanoid made no difference in that regard.
Please help me

Could ypu post the moving code?

Thank you for the reply.
Actually there is no movemet code at all, since the movement is animated with root motion. I made a small example. When you watch the test object it moves exactly two squares. But when activating gravity in its rigidbody component, it moves a little less. It may not seem that big of a deal in this example, but all my animations look really unnatural and the problem seems to get more severe when the root motion is more complex. Maybe there is some friction happening, but how are you supposed to cope with that while animating?

2277060–152807–RootMotionScene.unitypackage (54.4 KB)

Hello again, I just found the problem. Without an assigned physics material there seems to be some friction by default. Adjusting these values solves this issue mostly.

Hey, did you try to switch ON AnimatePhysics in animator settings?

5 Likes

Thank u very much .This helped me after a long time :slight_smile:

Wow thanks, switching AnimatePhysics worked for me.

Hello there,
can anyone advise, I use root motion to move rigidbody, and it is fine in general, but there is a problem with the jump: during the jump animation clip, the rigidbody ignores gravity, in addition to this, if there is a root reversal in the animation (roll, vault), then rigidbody behaves unpredictably. is it possible to temporarily disable root motion following in rigidbody?

temporarily disable root motion

animator.applyRootMotion = false;

1 Like