I Like
I Like

Reputation: 1847

Unity Model Drifts during Idle Animation

Hi my idle animation is not working as intended. When the character is idling, it slowly moves out of place. I checked that the movement is not caused by the script.

It seems to be related to physics because when I turned on kinematics and turned off the character's collider the idle animation did not cause the character to drift. I scoured the web for similar problems, and can only think that my problem has to do with movement caused by the animation itself.

When I imported the animation from Blender I checked 'Baked Animation'. In Unity I also set 'Root Node' to None for the imported animations. From what I read, setting root node makes the animation interact with its surroundings (and move) whereas baked means the animation is purely visual. However, none of this solves the problem of the drifting idle animation. I am running out of ideas and would really appreciate your help.

I could manually freeze the position via script, but this seems like a workaround. Interestingly, when I first enter game view and the idle animation plays there is no drifting. However, after exiting a walking animation and playing the idle animation again I see the drifting behavior.

Upvotes: 0

Views: 1001

Answers (2)

Muhammad Farhan Aqeel
Muhammad Farhan Aqeel

Reputation: 717

Root motion is the main reason why a 3d model moves away from its pivot without the help of a script. uncheck it from the import settings.

Upvotes: 0

Evgen
Evgen

Reputation: 21

Looks like you just need to uncheck 'Apply root motion' in animation import settings (in the inspector when you clicked on animtion file).

Upvotes: 1

Related Questions