Search Unity

Generic To Humanoid - Rotation Problems

Discussion in 'Animation' started by Tanman1276, Sep 14, 2022.

  1. Tanman1276

    Tanman1276

    Joined:
    Mar 21, 2016
    Posts:
    4
    (If Images are not working right, I attached a PDF of this post with included images)

    REFERENCE IMAGES: https://imgur.com/a/BizD1ox

    I have this current Generic animation of a player aiming a rifle in the direction they are facing. The red arrow on the ground shows that this is the direction that the animation is facing. It is in line with where the player is pointing the arms / gun: (See GENERIC image)


    When I change the animation type in Unity from Generic to Humanoid (while keeping this same character model), I get this result: (see CONVERSION FROM GENERIC TO HUMANOID image)

    The issue is that red arrow. For some reason, changing it from Generic to Humanoid causes the animation data to think that the forward facing direction is slightly off to the side even though the visual of the character aiming is still facing the exact same direction before converting it to Humanoid. It bases this rotation on the character model’s hip bone, which you can see when comparing the two pictures above. Generic has the transform pointing perfectly centered and straight, while the Humanoid animation is based on the rotation of the hips, thus causing the offset. When I place this Humanoid animation on my Humanoid player, we can see the issue: (See MY PLAYER MODEL image)

    My character is facing straight ahead, but the aiming animation is slightly off because that’s what happened in the above picture. When converting from Generic to Humanoid in Unity, that red arrow showing the forward direction of the animation is slightly off and thus messes up the final animation of my character.


    MY QUESTION: How can I convert Generic animations to Humanoid without rotational offsets? Or, how can I edit this offset Humanoid animation so that it thinks the forward facing direction is the same direction as where the arms / gun are pointing?
     

    Attached Files:

    Last edited: Sep 14, 2022
  2. tcshaw91

    tcshaw91

    Joined:
    Jul 26, 2018
    Posts:
    7
    When you select the fbx file, in the inspector, tab over to the "animations" tab and scroll down to just below where it shows the length. There are a couple of things below it, "loop time" , "root transform rotation", "root transform position y" and "root transform position xz". I think if you play a bit with the "Root Transform Rotation" you may get the result you want. Try switching between "Body Orientation" and "Original" and/or try adding an offset. I had this issue with a few Mixamo animations where switching it from body orientation to original fixed it for me. Not sure if it will for you too, but if you havent yet, give it a try.