- Home /
Changing Animation Looping Range
Hi,
I'm used to using 3dsMax, in which we have something very similar to what exists in Unity, in terms of looping modes and keyframe ranges.
Though, I've been trying to use Unity's built-in Animation tools with no luck.
Say that I have created a new clip for a simple gameobject, and that I added a curve to its rotation xyz. The default range (which appears in color) is 1 second. So if I want to add a couple of keyframes at say frames 0 and 30 (0.5 sec), the animation will play from frame 0 to frame 60 before it loops. Also, very often, if you scrub through time farther than frame 60, it'll extend the range a few frames.
Furthermore, if you set the loop mode of the animation clip to 'loop', then the range will always expend to the farthest you scrubbed in the timeline.
I have looked in the Script Reference, it seems that this 'range' property isn't exposed anywhere.
Isn't there a way to edit the ranges in editor ? I want to make a 360 degrees loop that repeats properly. I need to set the range to frame 0-59 or 1-60 so that I skip the frame where the rotation is the same as last (or next).
Am I going to have to go back in 3dsMax ? I wish I could do this in Unity :)
Thanks for reading..
Hey - I wanted to submit a similar question. The solution provided below seems inadequate. Did you find a solution? $$anonymous$$y looping animation continues way beyond my last keyframe and I have no idea where is the setting to let Unity to "end the animation here".
@DannyB There doesn't seem to be a proper way to achieve this. The hack I referenced below worked for me, but the only other alternative seems to be recreating the animation from scratch and ensuring that you don't accidentally extend the length of the animation. I am sorry that this isn't better news. I wish there was a solution to this annoying problem.
Answer by numberkruncher · May 10, 2012 at 11:44 PM
I had exactly the same issue but the following advice seemed to work for me:
http://answers.unity3d.com/questions/229783/animation-editor-trimming-tail.html
Unfortunately, it didn't work for me. I'm back to 3ds$$anonymous$$ax when it comes to deal with animations more complex than door openings... Hopefully this will find a fix in a future release.. Unity's built-in animation editor has some good potential.
Your answer
Follow this Question
Related Questions
How to change the intervals between frames in the animation window? 1 Answer
Extract keyframe info from animation clips 2 Answers
Trimming down fbx animation, why is unity adding extra frames? 1 Answer
Extra frames being added to animation 1 Answer
[SOLVED] AnimationState.time doesn't work and returns NullReferenceException error 1 Answer