Hi,
So I’ve got two virtual cameras that I want to blend between. I want to zoom in with my second camera after blending and then I want to zoom out again after a certain condition is met. Actually, I’ve already somewhat described my problem here.
I have already achieved a blend between the two cameras with the following code:
firstVCam.enabled = false;
secondVCam.enabled = true;
And I am attempting to zoom in with the second camera after the blend starts with this code:
secondVCam.m_Lens.FieldOfView = 20; // zooming out is obviously just setting this value higher again
But there are some problems. First off, the zooming in with the secondVCam
does not have any visual effect unless I pause my game, which happens with this code:
void PauseGame() {
isRunning = false;
Canvas ().pausePanel.SetActive (true);
Time.timeScale = 0;
Cursor.visible = true;
Cursor.lockState = CursorLockMode.Confined;
}
However, the zooming in does have an immediate visual effect if I instead set the FOV on the firstVCam
. But I cannot do this because the actual camera’s physics start to get wonky if I do this stuff on the firstVCam
. I believe that the root cause of this problem is that the firstVCam
remains in a “Live” status even after it’s not enabled
. The reason for this seems to be that the vcams do not stop blending. I determined this by putting the following code in my Update()
method:
Debug.LogError("IsBlending: " + Camera.main.GetComponent<CinemachineBrain>().IsBlending);
Which continuously outputs IsBlending: True in the console.
It seems that the cameras do not stop blending, which explains why the firstVCam
refuses to stop being “Live”. According to CinemachineBrain.IsLive()
's summary:
So I think I need to somehow forcibly tell my vcams to stop blending at a certain point. How do I do that? Also, am I correct in my assumptions as to the underlying causes of these issues? I would certainly appreciate any feedback to help me get a better understanding. Perhaps @Adam_Myhill can provide some insight?