- Home /
Smooth loop animations?
I have an animation on my gun that when w or s is pressed it plays a walk animation which is looped, this is all fine but when the animation has finished and starts again it stops for about half a second because the start of the animation is the the same as the end. Is there anyway within Unity that I can change this so it smoothly carries on the animation?
Answer by tmendez · Jun 12, 2017 at 08:45 AM
I've got my problem to work by just right clicking on the first and last keyframes and setting them to auto!
To clarify this for future beginners and readers:
1) Select the object that you are animating
2) In the Animation view (where you made the animation) there is a list of all the parts and properties you animated. Underneath that list is a button labeled "Curves." Click that button. [[your view will change to show a bunch of flowing lines]]
3) Click and drag to highlight all the keyframes at the beginning of the animation. Right-click, then select "Auto". [[you will see some of the curves jump as they are recalculated]]
4) Click and drag to highlight all the keyframes at the end of the animation. Right-click, then select "Auto".
5) Play the animation and it will loop smoothly.
$$anonymous$$an, I just love you so much right now!... THANKS.
Do you know how to accomplish this in 2d? My animation isn't looping smoothly and I just have keys while my curves view shows nothing.
Much appreciated.
Answer by Berenger · Jan 30, 2012 at 05:10 PM
In the project pannel, click on that animated object to see the import settings. all the way down, split the animation and make it finish one frame earlier.
This kind off messes my animations up I now have my reload animation happening what ever I do, is there anything else I need to do?
In your scene, click on the object we are talking about, set playOnAwake and Loop to false. That should do it.
Where does it say PlayOnAwake and where do I change loop to false?
I think he meant uncheck 'Play Automatically' in the animation component of your gun object. Then if the reload animation loops and you want to fix that, then you can double click on the reload animation and there you will get options etc for that animation. There you can set wrap mode to default. I think that's what he meant..
I have done all that but my walk animation still dosent loop smoothly.
Answer by Ulfhedinn · Mar 06, 2012 at 08:47 AM
When you're splitting the animations, there's a "wrap mode" rollout. Set your run sequence's wrap mode to loop and the end frame to the second-to-last frame of the animation. This creates a frame at the end that interpolates between the two frames and creates a smooth loop.
If that doesn't work for you, use the separate file option.
Answer by MagicBrooms · Feb 23, 2020 at 10:34 PM
I had the same issue, but only got it to work by adding more keyframes on top of turning them to auto (apparently the auto-keyframes don't like it if the whole clip has only 4 keyframes, so just add more keyframes in between).
Your answer
Follow this Question
Related Questions
How do I loop an animation with Unity 4.3? 5 Answers
Animation & Script Help 2 Answers
Animation plays at original position? 1 Answer
How can i make this animation play only once? C# 1 Answer
Animationproblem with Lerp-Function 1 Answer