Hiya! I was wondering what the best way to find out if a virtual camera has fully transitioned to another one is?
I’m planning to set my camera active and then do something like this in a coroutine:
while (cinemachineBrain.IsBlending)
{
yield return null;
}
I don’t know if there’s any pitfalls in doing it this way or if there’s a better way, so I’d appreciate anyone’s advice on this.
(The ActivateCamera function is just setting the virtual camera object active and deactivating the others in the list)
Is this still the best/ only way to wait for a blend to be finished or is there some other way? I checked the documentation but this was all I could find.
private IEnumerator ChangeCameraAndDoSomething() {
ChangeCamera();
// cause IsBlending has little bit delay so it's need to wait
yield return new WaitUntil(() => mainCamBrain.IsBlending);
// wait until blending is finished
yield return new WaitUntil(() => !mainCamBrain.IsBlending);
WhatToDoAfterFinished();
}
mainCamBrain is your cinemachine brain usually on main camera,
it’s may not a best way but it’s work