Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Animation starts in floor

Discussion in 'Animation' started by kromblite, Jun 8, 2018.

  1. kromblite

    kromblite

    Joined:
    Mar 19, 2014
    Posts:
    23
    Since I added animations to my character, he starts halfway in the floor, before immediately rising out of the floor to stand the way he's supposed to. What am I missing here? Why is my character doing this?
     
  2. symorian

    symorian

    Joined:
    Jun 7, 2017
    Posts:
    22
    Hi,

    Have you compared the player gameObject's initial x, y positions to properties in your animation's starting frames?
    Sometimes this also happens to me if I accidentally forget to equalize animation properties to initial properties of go's when I do not pay attention to "record" mode in animation window.

    Cheers,
     
  3. kromblite

    kromblite

    Joined:
    Mar 19, 2014
    Posts:
    23
    Hmm... well, in 3ds max, I have a base object called "Base" that is the parent object for everything else in the heirarchy. It appears that's what's moving in the unity scene- but in the animation, it doesn't have any animation keys. All the animation keys are on its child bones.
     
  4. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,525
    I am just poking in the dark here but...

    If you added a CharacterController component to your character, check the capsule to make sure it is not saying "It's 2 units tall and the origin is at the model's Base node". That will result in your character's collider being 1 unit under the surface when the scene starts. Simply move the capsule up till it's above ground by setting it's center in the inspector if this is the culprit.
     
  5. kromblite

    kromblite

    Joined:
    Mar 19, 2014
    Posts:
    23
    I do have a character controller, but I'm not seeing anything about a base node.
    Also, in an attempt to prevent this kind of problem, my animation isn't a direct child of the characterController object. That object has a child called AnimPositioner, and the imported animated model is the child of that.
     
  6. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,525
    When you added the CharacterController, didn't that automatically add a capsule collider? I meant to say that your character got a collider added to it and half of the collider would be underground unless you raise it's center. Since the collider is underground the first thing it will do is try to NOT be, hence jump up the 1m and taking the character with it. But like I said it was a shot in the dark. If your capsule collider is setup properly then disregard.

    A very easy way to see is to just click on the root of your character prefab so that all colliders are visible. Now just see if you have a capsule collider and if it's neatly placed around your character. If so then that was not it.

    The only other time that I have seen my characters go half way into the ground is when they are trying to play an animation that doesn't match their skeleton. Since they basically have no animation info they go into a pose that looks like they are squatting and they drop to halfway down the ground but they usually stay there. They don't get fixed the next frame.

    Afraid this is all the insight I have to share, sorry if this didn't pan out.