- Home /
How to auto add animation clips
Our 3D modeler imports FBX models into unity that contain simple animation clips, lets assume they're all doors that either animate to the closed or open posistion, drops the model into the hierarchy, then sends it to me (the programmer) .
What steps as a programmer do I then take to utilize the clips the door came with?
I see that Unity automatically creates an Animator on the door but this doesn't work.
myDoor.GetComponent<Animator>().Play(1);
I assume unity smart enough to create an animator because it detected animations but not smart enough to import the animation clip and assign it to the animator.
Is there a way through code to use the Animator component but avoid having to create an animator controller open the mechanim GUI to assign the clip and states all manually?
The goal is to import models with a single animation and get it working with as few setup clicks as possible. Having to jump through GUI hoops, create and keep track of animator controllers seems messy and clunky.