I made 2 animations, one idle animation and a running animation and they are saved as separate fbx files.
Now I can play the animation separately but I dont know how to change the animation state from idle to run and run to idle because I dont know how to link these together. I know you can make a big animation file containing all the states and then you can split the animation in unity3d but Im still a beginner so Im just taking taking little steps.
Hi!, you must to add both animations into the animation component of your gameobject… what you have in your gameobject´s animation component is only the run animation, just draw the second animation to add to the list…
then, use CrossFade to change between animations:
animation.CrossFade("run"); //to run
and :
animation.CrossFade("walk"); //to walk
Note that you can import a big animation timeline containing all your animations, for instance in your case, both animations (idle and run) in only 1 animation, lets say:
from frame 0 to 10 : Idle
from frame 15 to 20 : run
then, export your animations with your mesh and armature…
at the import time, in the inspector panel you separate both animation, unity automatically creates separated animation clips for idle and run, you only configure the frame intervals.
that´s is a lot easier to manage than exporting your animation separately …
Also in some animation programs you can export them as separate actions in one FBX file, which means you don’t need to put them all on one timeline (which could conceivably cause headaches with keyframing/splines). Blender as an option to export all of your models actions in one FBX file. Unity will automatically create the animation component for you with the animation states corresponding to your model’s actions.
There are instances when exporting them separately makes sense though (like you want to add another animation to your model but you don’t want to reimport the whole set.)
i know you can make a single file containing all the animations and then split them up in unity but im not that good at animating yet, I make an animation and it doesnt look right so I go back and try again and it would be a pain in the neck to make all the animations again. Im using Motionbuilder to animate and I dont know how to edit animation yet :razz: I usualy make the whole animation from the beginning if its not right =)