So, I’m having a base CinemachineFreeLook cam as the character camera, and playing a timeline on awake, I can get it transitioned nicely to the Cinemachine clip in the timeline from the base cam, but if I wanted to stop the timeline from playing depending on the current situation in-game, it will jump-cut back to the base cam instead of a transition.
Here’s a gif for better visualization
In the gif, I’m pressing “a” to stop the timeline around the cam blends in the timeline
public class Test : MonoBehaviour
{
public PlayableDirector d;
void Update()
{
if (Input.GetKey("a"))
{
d.Stop();
}
}
}
Is there any way of dealing with this kind of situation. If possible, doing manual transition in code when stopping the timeline.
I looked up the forum and saw that CM used SetCameraOverride for overriding the default behavior of CM for Timeline, so is it that ReleaseCameraOverride will ignore the transition somehow?
Thanks in advance!
[Edit] was intended to post in CM forum, since its more CM related, but accidentally posted here.
While the timeline is active and overriding the current virtual camera, the priority system is still active under the hood. Maybe you can try something like this: when you want to stop the timeline, get the current active camera from the brain (it will be the current timeline override vcam) and boost its priority so that it’s higher than the normal vcam. Then stop the timeline. Next frame, lower the priority of that vcam again, and it will blend back to the normal vcam.
Thanks for the suggestion, just tried to raise the priority of active vcam upon key press but seems it still jump back to the default camera upon stopping the director,
so I tried a bit hacky way by trigging RaiseCameraPriority below via signal before the transition in timeline happens, and it kinda works…