- Home /
simple question about animation
Hello
I work with different type of animation with the animation tab in unity 3d. i can easly make it loop with the option buit in. but can i make an animation loop when i import it from maya or max. for exemple i have a bounce ball animation made with 3ds max. i import animation in unity and it work fine but i can't make it loop. the loop option dosn't work. can i make it. thanks
Answer by incitement · Sep 01, 2010 at 11:13 AM
Thank you for your Help. I found the answer of my question. The script should be like this ;
function Start() { animation.wrapMode = WrapMode.Loop; animation.Play(); }
and it work fine.
Please mark your answer as a correct one (one you're allowed to do that), so other people can see that it is answered.
Answer by Wolfram · Aug 31, 2010 at 10:08 PM
You either need to set the animation to loop in the modelling program, or you need to use a script to set the "loop" flag in Unity manually. For the simple case (only one animation for the object, and have it play automatically), you can use:
function Start(){
animation.loop=true;
animation.Play();
}
I would imagine it should be possible to set the loop-flag of the animation in the import settings in the inspector, and re-import the model, but I don't know about that.