- Home /
Play a Timeline from Marker X to Marker Y?
Is it possible to use Markers as start and stopping points for a Timeline?
Say I have a Timeline with an animation, and when I get within a certain distance to an object I want to play the timeline from start to Marker X and then it should pause there, until I get within a shorter distance then it should continue playing from Marker X until Marker Y when it pauses again until I get even closer, and so on, and so on. Also it would be nice to have something like myTimeline.Play(fromMarker, toMarker) so that I can jump back and forth in the timeline at will.
An alternative would be to have seperate timeline but then if I change the end frame of the first timeline I have to remember to also change the start frame of the next timeline, and that would be a lot more and more confusing work. It would be easier to just maintain one timeline and use markers to define start and pause positions.
I noticed that a Signal can actually be received by the same PlayableDirector that is sending it, and I can call the Pause() and Resume() functions from there. One issue with this though was that the marker is set at frame 150 but the timeline didn't pause until 151, so the signal is only queued at the marker but the signal isn't processed until a later frame, is it guaranteed to always be one frame later though? Also, I still would like to be able to start a timeline from a particular marker rather then from the beginning. And be able to play a complete timeline without any interruption.