Animation loops seems to hang on last frame
Hi,
I have a strange problem. I have created a simple rotation animation by using the Unity Editor: It simply rotates the record from 0 to 360 degrees. I also created an animation controller, which starts the animation after a trigger has been set and loops it until another trigger has been set:
My problem is that the animation does not really loops. It seems to hang on the last frame (where Rotation.y hits 360), stops for a split-second and then starts again at 0 degrees. I have no idea why this happens. I checked "loop" and "loop pose", I also changed the last key-frame to 359 (since 0 degree and 360 are the same), but it still seems to hang on the last frame.
Any idea how to fix this?
Thank you in advance.
Answer by pes04 · Apr 05, 2017 at 02:47 PM
I fixed the problem. The curves weren't right. After I made them linear, everything is as intended.
Answer by rubendariohh · Dec 02, 2017 at 03:28 AM
How do you did that?
In the Animation window, there is a tab bar. One says "Dopesheet", the other is "Curves". Click on "Curves", than you will see the the curves. Do a right click on the key frames. There are dialogs for "left", "right" and "both" tangents. In the sub menue you can select "linear".
sadly it didnt worked for me :/ $$anonymous$$aybe its because Im trying to animate a rect transform? could be it? @pes04
@pes04 Was there a way to select all key frames to do this?
Answer by TheFastLane · Sep 16, 2020 at 03:18 PM
(2019.1) Open the "Animation" tab, select the "Curves" tab near the bottom next to "Dopesheet" (you should now see lines that look like a graph), press "Ctrl + A" to highlight all nodes, right click on a node and select "Both Tangents" -> "Linear"
Your answer
![](https://koobas.hobune.stream/wayback/20220612114744im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why my animations stay on the last frame in the scene before trigging to play? 0 Answers
Prevent Character from moving via animation 1 Answer
How to play 'open door' animation on only one door? 0 Answers
Rig screws up when model is imported into a different project 1 Answer
Syncing character animation with game object's local transform (SOLVED!) 1 Answer