How do I get an animation to loop back from a certain point?
I have an idle animation I want to use, but near the end, it loops back to the start. I want to make it only loop the ending part. Any way to do this? I'm using Unity 5, and creating a 2D game.
Answer by Zoogyburger · Feb 15, 2016 at 05:19 PM
Take a look at this: http://docs.unity3d.com/Manual/LoopingAnimationClips.html
http://docs.unity3d.com/Documentation/Components/FBXImporter-Animations.html
Not sure how to get that window up. It mentions something about $$anonymous$$ecanim, whatever that is, but I'm not too familiar with it.
$$anonymous$$ecanim is Unity's animation state machine system. It essentially allows you to create 'states' that play animations and define transition logic that will tell your game how to move between the different states. See$$anonymous$$gly I can't get the window open either? Give me a sec and I will post a work around.
Perhaps you want to make your Idle animation two animation files, One with the part you don't want to loop and the other with the part you want to loop. Inside your animation controller (unity automatically makes on for you when you create an animation ) right click and create a new empty state. Inside that state set the motion to be your other anim file. $$anonymous$$ake a transition between the one state to the other.
I hope I explained this well but if it's too confusing maybe code like this will work
animation["$$anonymous$$yAnimation"].time = 5.0;
Wow! It worked! Thanks! I was starting to lose hope since it's been 3 days since I asked. Not sure how'd you find this since it got buried, but I'm glad you did!