I have a timeline with a Cinemachine track on it that does a simple blend from any virtual camera to a specific virtual camera with a duration of 2.5 seconds. The wrap mode for the Playable Director is set to Hold.
What I am trying to do is play the timeline to blend from one camera to another but allow the blend to be interrupted by the user’s press of a button. So, if the player pushes a button, I want the timeline to jump to the last frame of the Cinemachine track. I do this by setting PlayableDirector.time = PlayableDirector.duration.
There seem to be 2 issues:
(1) If I wait till the timeline is completed playing and then set the PlayableDirector.time to PlayableDirector.duration, the Cinemachine clip jumps to a position past the last frame of the clip. Is this a bug?
(2) As a workaround to this issue, I tried only setting PlayableDirector.time = PlayableDirector.duration if PlayableDirector.state == PlayState.Playingis true. However, even after the clip is done playing,PlayableDirector.state == PlayState.Playing is still true. Could this be because the wrap mode is set to Hold? Is it possible to add a state called PlayState.Holding in order to differentiate between the 2 states?
Yes, I am doing that. However, if I set the PlayableDirector.time = PlayableDirector.duration after waiting for the timeline to complete, then the timeline jumps to a frame past the end of the clip. If I set the PlayableDirector.time = PlayableDirector.duration before the timeline has completed, this doesn’t happen. The timeline is set to the last frame of the clip. I was wondering if that was a bug or not?