- Home /
Import animation clip via script
Hi guys, I need some help with importing an animation through a script.
I have a 3D model of a character(1), this character has animations attached. I need to be able to add the animation clip(2) to the character animation list(3) through a script. Could anyone help me with this please? Thank you!
Answer by ThermalFusion · Sep 07, 2012 at 10:02 PM
I read that already, but how can I import Animation clips from objects that lie in Assets?
That gets a little more trickier. You could do it by putting the models in the resources folder. You then have to load the asset and get the clip from it, in my testing i found no direct way to load it.
GameObject tempGO = Resources.Load("model") as GameObject;
AnimationClip newClip = tempGO.animation.GetClip("animation");
man, thanks a lot! that at least gives me a head start with this issue ;)
Your answer
Follow this Question
Related Questions
Can I make animations snap to a frame? 1 Answer
moving animation clip to animator controller 0 Answers
split animations problems 2 Answers
animation blender to unity problem 0 Answers