Search Unity

Question Interrupting A Camera Transition With Another Transition?

Discussion in 'Cinemachine' started by Payaso_Prince, Mar 9, 2022.

  1. Payaso_Prince

    Payaso_Prince

    Joined:
    Jul 17, 2017
    Posts:
    92
    Hello All,

    I have three Camera that transition from A > B > C when the player reaches certain points.

    If the camera begins transitioning from A > B, but then is interrupted by transitioning to Camera C, I am getting weird speed/rotations. Is there a setting to allow Virtual Camera transitions to be interrupted by another camera? o_O

    Thanks!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    They can be interrupted by default. One thing to remember: if transition A->B is interrupted with a transition to C, then all 3 vcams are contributing to the blend until the source transition is finished. That is, you're getting (A->B)->C. If you delete or alter A or B too early, then you can get a pop.
     
  3. Payaso_Prince

    Payaso_Prince

    Joined:
    Jul 17, 2017
    Posts:
    92
    Hey, thanks for the response Greg!

    Ah, that makes sense. In that case, is there a way to stop the current blend if it is unfinished and begin a new blend?
    Do you have any suggestions to get around this?
    I don't think I can avoid the player triggering Camera C's transition in the middle of A->B...
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Like I said, it's not a problem to trigger C before the A->B blend is finished. Can you let the A->B blend play out before altering A or B? If you need to move one of them somewhere else, maybe you can use another vcam instead? The rule is: as long as vcam.IsLive returns true, leave it alone because it's contributing to the main camera position.

    If you're dead set on making a snapshot of (A->B) you could dynamically create a stationary vcam using the main camera's settings at that moment, cut to it, then blend into C from that.
     
    Payaso_Prince likes this.
  5. Payaso_Prince

    Payaso_Prince

    Joined:
    Jul 17, 2017
    Posts:
    92
    Hey, sorry I'm so late to get back. Great ideas all around!

    I guess my final question would be is there a way to check if there is a current blend playing?
    That way I could do something like:

    Code (CSharp):
    1. If(!Blending)
    2. {
    3.      //Transition to next cam
    4. }
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    CinemachineBrain.IsBlending
     
    Payaso_Prince likes this.