Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Why are animations causing my character to float?

Discussion in 'Animation' started by Burismiga, Oct 28, 2019.

  1. Burismiga

    Burismiga

    Joined:
    Feb 3, 2015
    Posts:
    7
    Hello,

    I'm having an issue where my character floats in the game when I have an animation controller with an animation attached to the character. If I remove the animation controller from the character and have it move in the game without animations it will move flush with the ground so I'm assuming the issue stems from the animations. I'll upload an image with the animations import settings.

    Thank you for the help

    https://imgur.com/a/gODwtiZ

     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,448
    Hi and welcome @iankarasz,

    You will have to adjust your character's animation, there's probably space there between the ground. Check the vertical axis settings (Root Transform Position (Y)) and add offset. This is most likely the reason. You could also have some parentation hierarchy in your character, like a root object, under which you would have your actual character hierarchy.

    P.S. You could use forum image attachment so that we don't have to check external links like Imgur.
     
  3. Burismiga

    Burismiga

    Joined:
    Feb 3, 2015
    Posts:
    7
    Ahh im sorry. Here the image from the link:

    floatIssue.PNG

    And thank you for the response, @Olmi !

    I'll try adding some Y offset.

    As for the parentation solution it looks like the root is already a child of the character prefab (I'm using some assets I bought from the asset store). Should I try reversing it?

    Thanks again for the help. I've made a few games in unity before but they've all been 2D. This is my first time working in 3D with character models and its been a bit of a struggle.
     
  4. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,448
    3D character things can be trickly sometimes, in Unity and in other environments. Just smash the like button if you got the problem fixed. :)

    Parentation - No, don't change anything until you know what your character needs to do. I suggest you prototype everything (critical things) your character needs to do before you lock down any specific character structure/hierarchy.
     
  5. Burismiga

    Burismiga

    Joined:
    Feb 3, 2015
    Posts:
    7
    Gotcha!

    I just tried it out and adjusting the Y offset does move the character closer to the ground so I think if all else fails that is something I go with.

    Looking at the inspector for the animation I did notice that the model looks like it is floating in the view underneath the settings. Did we import the models incorrectly for it to be so high up in the Y axis?

    floatingModelAnim.PNG
     
  6. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,448
    It might be that you have some transform you need to apply or you have just animated it in "wrong" location. Check it in your 3D app, if it's there seemingly in correct location but imports to Unity slightly wrong, it's most likely a transform.
     
  7. FireKebab

    FireKebab

    Joined:
    Feb 26, 2021
    Posts:
    2
    Hey! I had almost the same issue (Solved it right now!), When my character died, the animation was flying him up in the air a bit.
    When you open ur animation settings in the inspector (in my case it was dieing), you go down, there is Root Transform Position (Y) - height ofc(which we need in this case) - put it on Based upon (at start) : Feet
    This made the animation put its root to his feet. Hope you can understand and i hope it helps :D Gl
     
unityunity