Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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:
    40
    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:
    45
    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:
    40
    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,570
    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:
    40
    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,570
    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.