- Home /
Create animation sequence from different FBX models
For my game, I have purchased following assets from store. Giganotosaurus - Low Poly & Animated Dinosaur
In this you can see that there is different fbx files for run, bite, chase, walk, death etc. I want to create dinosaur animation sequence and want to play directly through animator all animation. But at present all animation exist in different fbx files so how to merge all animation in single file.
I want something like following image so that directly change animation through script :
Please give some suggestion in this.
Answer by flashframe · May 06, 2015 at 04:13 PM
If all the animations are using the same model, just in different files, you can attach them to an Animator Controller on your game object.
If you twirl down the FBX prefab in the project window, then you will see the animation clips. You can drag and drop these individually into your Animation or a new Animator Controller. I would use an Animator Controller.
You can also rename the animations in the FBX import settings.
If I add any fbx model in project window then it has following inspector window.
Now what I have to do next?
In the Project window, create a new Animator Controller. Drag that controller into the Controller field in the inspector window.
Open the Animator window.
Then in the project window, find your FBX files. They should have a little arrow on them that you can twirl down to reveal their contents. Inside, you will find the Animation Clips (they have little play button icons). You can now drag and drop those clips into the Animator controller for your game object.
You can drag and drop all the animations onto one model, and then use code to control which animation to play.
I am not getting success in playing multiple animations. I have created Animator and assign two animation over there. Following image represent what I have done.
In script I have written this code :
Animator dragonAC;
void Start ()
{
dragonAC = GetComponent<Animator> ();
StartCoroutine (DeathAnimation ());
}
IEnumerator DeathAnimation ()
{
yield return new WaitForSeconds (2f);
dragonAC.Play ("Death");
}
Now actual animation change to Death but not any movement shown in dragon. Please give me some suggestion.
You only need one of the FBX models in your scene. I'm presu$$anonymous$$g each animation uses the exact same model. Correct me if I'm wrong,
At the moment you have your Animator Controller applied to an empty game object, so there is nothing for the animation to manipulate. Try adding the animator and script to either the Gigantosaurus or Run gameobject, and delete the other from the scene.
You can test it in the editor, by opening the Animation window, and selecting the different animations from the drop down menu and scrubbing playback.
I have dragged one fbx model into Hierarchy window. I have done nothing else from my side. Empty object created by itself.
Fbx models detail available in this form.
What I have to do next?