Summary:
Basically, I need to be able to loop the timeline from frame Fx to frame Fy for an amount of time that is specified by user interaction (unknown a prior).
Use case:
The user can Tap or Hold a button:
a) A Tap triggers an effect that needs to be executed for a pre-defined duration (fixed time).
b) A Hold triggers the same effect, but it loops until the user releases the button.
Current status:
I’m successfully achieving this by using animation states (Animator). I define 3 states: In, Stay and Out.
Then, it simply works by looping Stay state while user holds the button.
Question / requirement:
Since Timeline was release, I wanted to try it out because it looks awesome.
I implemented several effects using Timeline. But I don’t know how to replicate the Hold behaviour.
I only can Tap them.
How can I hold / loop a sub-section of the timeline?
Is this even possible?
Blending in timeline at arbitrary points in time is possible, in some cases, but not straightforward. There is another thread about it here . It may be of use if you are looking to try and script in a blend when jumping time, however it would only apply to animation tracks.
Thanks for the lead! i was able to get what i wanted working. Although i’m sure there are lots of situations where this will currently break, here’s the code in case it helps anyone:
I opened this in 2021.1 and it does not work for me.
Unity tells me SetSourceOutputPort is deprecated and should be replaced with
SetSourcePlayable(value, port) which I did* but the graph no longer outputs to the animator.
The visualizer shows me that the timelines exist and the mixer blending works but still nothing moves.
Can anyone help me figure out why this does not work?