Search Unity

Avatar moving when starting second animation

Discussion in 'Animation' started by Tech-Labs, Mar 19, 2014.

  1. Tech-Labs

    Tech-Labs

    Joined:
    Feb 5, 2014
    Posts:
    105
    I've imported a 3DS Max model in Unity (4Pro).
    I used the avatar@animation.fbx naming convention.
    So I've got 1 avatar humanoid model without animations. This is the one I create an instance of in my scene.
    Then I've got 2 fbx exports with animations. One called f004@cool.fbx which has just 1 idle animation and one called f004@face.fbx which has about 50 facial animations.
    Using an Animator the cool animation starts automatically when I run the scene. So far so good.
    Just to test I've added a simple key-catch script to the avatar that sets a variable in the Animator.
    Once the key is pressed, a transition is activated and one of the facial animations is played.
    Now that all works :).

    The thing is that when the facial animation is started the avatar moves downwards (just Y translation).
    Apparently the model attached to the f004@face.fbx has a different Y coordinate and so when played Unity blends the animations and starts moving the avatar down.

    However, it's the same model from Max. I just load the model, then load the animation then export it to FBX. So the model should be in the same position. There's no translation in the Max animations.

    I've tried dumping the avatar in an empty gameobject, no difference.
    I've tried first creating the empty gameobject, then adding an instance of the avatar, no difference.
    I've even tried some of the work-around scripts that simply reposition the avatar in the lateupdate(), no difference!

    Anyone any idea why this happens and how you can control it?

    Thanks!!