Search Unity

Imported baked animations snap into a locked postion when played in Unity

Discussion in 'Scripting' started by asan, Nov 29, 2010.

  1. asan

    asan

    Joined:
    May 7, 2010
    Posts:
    4
    Hello guys,
    I've created a basic weapon animation in 3ds max with a arms/gun firing a shot/reloading etc. It works nicely within 3ds max, but in Unity it seems that the weapon+arms snap into a predetermined position when the animation is loaded.

    I can manually position the objects and if i unclick the automatic animation playback they will stay the same place when unity is running. However when i load the animation clip from a script they will snap back into another position whilst the animation is running. As soon as the animation is done the objects will return to the previous position(the script is trying to make the objects stay at a particular position through setting transform.position to a vector of choice).

    I'm thinking the problem is to find when i check 'bake animations' in import settings. However, if this is left unchecked then the gun doesnt follow the hand accordingly because it's using a position constraint.

    Im attaching the 3ds max 2011 file,

    Any feedback is appreciated!
     

    Attached Files:

  2. potan

    potan

    Joined:
    Nov 2, 2008
    Posts:
    177
    In your 3d program, parent the Gun/Arm to a dummy object.
    (as far as i know anything that has translation / position (x,y,z) animation has to be parented to a dummy object),
    but scaling/rotating is ok (you don't need to parent it to a dummy).

    hopefully that works :p