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

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,553
    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.
     
    JonathanEmerick and azeem_ehsan like this.
  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,553
    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,553
    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
     
    marijapopovic and azeem_ehsan like this.
  8. nstephens922

    nstephens922

    Joined:
    Nov 3, 2023
    Posts:
    1
    Hello, I am facing the same issue, but I can't seem to stop my character from floating upwards for any reason. I have looked a bit at the Root Transform Position (Y), but only checking "Bake into Position" makes the character not float. However the issue is then that the character sinks through the floor instead, and I don't know how to stop that either.
     
  9. marijapopovic

    marijapopovic

    Joined:
    Nov 25, 2022
    Posts:
    2
    Thank you so much this saved me! :D