Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Strange Rotation when using Humanoid Avatar

Discussion in 'Animation' started by Mehd, Jun 3, 2018.

  1. Mehd

    Mehd

    Joined:
    Apr 29, 2016
    Posts:
    91
    Hello,

    I created a character with a rig that fits into Mecanim so I can use IK control in-game. Problem is, when I play some animations, namely run for now, my character both:
    • Seems to have some root movement, while I don't think I enabled it.
    • Which makes it turn (ie: it is not facing the direction I left it in when I pressed play.
    Could somebody point me my error ?

    Here's a small video to see the problem:


    Thanks a lot !
     
  2. Ermiq

    Ermiq

    Joined:
    May 1, 2018
    Posts:
    11
    I'm a noob, but I have some thoughts and I would be glad to help.
    Check your animation keys. Maybe your animation rotation keys rotate bones relative to global coordinates instead of local coordinates.
    Open your animation file in Project window and try out different settings in Inspector. Especially "Transform root rotation" settings. But first you should check if your animation keys are correct.
     
  3. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Sorry, it's been years since I had this problem so I don't recall the exact solution but if memory serves this was due to the animation you are using not facing forward in it's starting frame. the root node might be slightly rotated during the idle pose for instance.

    In this case you want to toggle between using the root orientation of the animation and the root orientation of your character. Click on the animation and then in the inspector look for this:
    3.JPG

    Try both options and then try baking the rotation into the pose. I THINK that was it, but I could be wrong.
    Hope that helps. :)
     
    OAI01 likes this.