Search Unity

Mecanim bug, non in-place animation

Discussion in 'Animation' started by bowragon, May 30, 2014.

  1. bowragon

    bowragon

    Joined:
    May 30, 2014
    Posts:
    1
    I have a fbx gameobject prepared here with 2 child bones. These bones don't have any direct effects on each other. The red cube represents bip01, and the green sphere represents enemy motion.

    In 3dmax:
    30 frame animation.
    frame 0-15: both cube and sphere move 100 units to the right.
    frame 15-30: sphere moves 50 units to the right at frame 22 and moves back at frame 30.

    at frame 0:
    $Untitled-1.jpg
    frame 7:
    $Untitled-2.jpg
    frame 15:
    $Untitled-3.jpg
    frame 22:
    $Untitled-4.jpg
    frame 30:
    $Untitled-5.jpg

    In Unity3d:
    Root bone is set to bip01, because I need the gameobject to move according to the animation of bip01 in game (non in-place) and the enemy motion bone to move accordingly.
    Now we play the animation in Unity.
    expected effect:
    frame 0:
    https://q5yrza.dm2302.livefilestore.com/y2pAF8L_OcoXu1_sMJbCgREUv-Pco7W8SKehTYfuxPkJ6pxa01LuStAHBbUAUiNwPNp8QhR5NrIjLEPpQA4InK4KuqykYydCVuMpxvKfZSH2AA/screenshot1.png?psid=1
    frame 30:
    https://q5yrza.dm2302.livefilestore.com/y2pcBmgWE6bxtrXIK9ephJjF_iqd9LfwQWqzQkrjhG1UmpC4QhjnLJ-wf6uo6FhB729gc3e48V7_JoswVl8VzGF822A-Fq6dUg4-b7deC9_CDY/screenshot2.png?psid=1

    result effect:
    frame 0:
    https://q5yrza.dm2302.livefilestore.com/y2pH8vLNkMKapX2vqLWo9jN5lhlwQGbmk-OtuVFyCglsAvnVHw6htukvYUBWXQ_OJe-kthi-lgRT-H1wwIsxiU0_9noshA-O93sob_hHJD-Vgw/screenshot3.png?psid=1
    frame 30:
    https://q5yrza.dm2302.livefilestore.com/y2pRg6tH8TxW_TivnoSMnKTpLsuD2EwFjLF9Ez8VHNiXkCqk8-ibEO5WV7ppuHeSjLmggjDJjtxI0btzbNVqlGc_2xVuiF1AbcZEOL1Lpf0fD8/screenshot4.png?psid=1

    My speculation about the difference in the results is that the displacement of the enemy motion bone is added on top of bip01's displacement instead of the fbx gameobject's displacement. As a result, the final displacement landed farther than I expected.
    This bug can be fixed by setting root bone to none, however that is not an option here since I need the animation to be non inplace. If I set the root bone to none, then the position of the fbx gameobject would not change according to bip01's displacement.