I’m having trouble looping a recorded animation with the new timeline feature. Here is what I’ve done and where I get stuck:
Created game object (cylinder in this example)
Created timeline asset for cylinder
Turned on timeline record mode and made a simple 2 keyframe animation
Turn recorded keyframes into animation clip
Animation plays fine
Set Post-extrapolate to “Loop” in clip inspector
Stretch clip in timeline, but it never loops, it defaults to “Hold”
I want the animation to loop for the entire duration of the game, over and over again as long as it’s playing. What’s the best way to achieve this? – preferably avoiding C#, I’d like everything to be accessible from the GUI if possible.
I would also like to know if this is possible. So far we have been assuming looping only works when we use an Animation clip … which is very frustrating, since it forces our artist to use two different methods depending on the use-case and increases the chance of problems occurring.
[Edit – Sorry, I think I misread the above. I was hoping for the recorded animation to be loopable without requiring it be turned into an animation clip or copy/paste frames.]
Your timeline duration is based on clips (the blue line in the timeline editor). Since your timeline ends when the clip ends, it cannot loop. In this case, you have two choices.
a) Change the PlayableDirector’s wrap mode to Loop.
b) Change the timeline’s duration
Right-click in the timeline ruler, then choose Duration Mode → Fixed Length.
You can then drag the blue line in the timeline ruler to expand the timeline duration. If your clip’s Animation Extrapolation is set to Loop, it will then loop for the whole timeline duration.
Is it possible to loop the clip withouth looping the whole project?
I have more tracks in the timeline (that don’t have to loop) and none of the above proposed solutions works in my case.
To loop a recording, you should be able to convert it to a clip, then set the post extrapolate option to loop. It should then loop for the duration of the timeline.
You can either not stretch the clip, and use a fixed length for the timeline (right click on the end marker). Extrapolate is what happens between clips, not what happens when stretched.
Or you can click on the Animation Clip in the timeline clip inspector to bring up the inspector for the animation clip itself, and enable looping on the recorded animation clip. When you stretch the clip it uses the properties of the animation clip being played, and recorded animation clips don’t enable looping by default. Alternately you can find the animation clip as a sub-asset of the timeline.
Is it correct to interpret this thread to mean that Timeline does not currently support an infinite loop and that the workaround is a very long duration timeline containing a looping clip?
For example if I wanted to have a timeline that contains an infinitely looping idle animation I would have to implement that idle with an animation controller and make that controller play nicely with the Timeline?
Yes, at least in 2018.2 and prior. With the changes to animation tracks in 2018.3, we are looking at ways to make this exact use case work (i.e. loop a timeline and have the animation track offsets update automatically on each loop). Not sure if that will make it in 2018.3 or 2019.1 yet.