Search Unity

OnCameraTransition / OnBlendComplete event

Discussion in 'Cinemachine' started by darthbator, Mar 2, 2018.

  1. darthbator

    darthbator

    Joined:
    Jan 21, 2012
    Posts:
    169
    Is there an event or other function I can grab that will tell me when a camera transition has completed? This would greatly help me ping pong or otherwise make quick transitions between my cameras. All of the functionality I've currently found notifies me when a transition or blend begins, I would ideally like to know when it ends. How am I meant to do this by default?
     
    Uttam_Kush and Meatloaf4 like this.
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,723
    There currently is no notification that a transition has ended.
    You could perhaps do it this way:
    When you get notification that a blend has begun, query the Brain for the active blend, check its duration and send your own notification at the end of that time.
     
  3. darthbator

    darthbator

    Joined:
    Jan 21, 2012
    Posts:
    169
    That's basically where I am right now. I catch the m_CameraActivatedEvent and then set a timer based on the current blend length. While it is working, emotionally I sort of hate this solution. Is there a central location in the brain responsible for running the blends where I could add my own event or am I stuck with this?

    Thanks so much for the quick response!
     
    Uttam_Kush and Meatloaf4 like this.
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,723
    You're welcome to mess around in CinemachineBrain.cs - look for where the current active blend gets set to null. However, if I were you I wouldn't mod the Brain. Just add your callback in a little standalone script next to the brain that listens for the camera activated event and broadcasts another one on the Brain's behalf.
     
  5. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    I know this thread is a bit old, but I wanted to pop in and add a +1 for a OnBlendComplete event.

    I'm curious how the majority of people are handling the use case of knowing when one camera has fully transitioned to another.
     
    ChainTechDev and avataris-io like this.
  6. SmoothPulsar

    SmoothPulsar

    Joined:
    Apr 21, 2018
    Posts:
    3
    Yes a OnTransitionEnd or OnBlendComplete would be reaaaally fine and it seems it would not take a lot of resources so why isn't it implemented already ?
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,723
    It's very easy to do as an add-on script. Here is one. Add it to your vcam. It will fire an event when the vcam has just become live and the blend is finished. Note that for this implementation a cut counts as a very short blend.
    Code (CSharp):
    1. using UnityEngine;
    2. using Cinemachine;
    3. using UnityEngine.Events;
    4. using System;
    5.  
    6. public class CmBlendFinishedNotifier : MonoBehaviour
    7. {
    8.     CinemachineVirtualCameraBase vcamBase;
    9.  
    10.     [Serializable] public class BlendFinishedEvent : UnityEvent<CinemachineVirtualCameraBase> {}
    11.     public BlendFinishedEvent OnBlendFinished;
    12.  
    13.     void Start()
    14.     {
    15.         vcamBase = GetComponent<CinemachineVirtualCameraBase>();
    16.         ConnectToVcam(true);
    17.         enabled = false;
    18.     }
    19.  
    20.     void ConnectToVcam(bool connect)
    21.     {
    22.         var vcam = vcamBase as CinemachineVirtualCamera;
    23.         if (vcam != null)
    24.         {
    25.             vcam.m_Transitions.m_OnCameraLive.RemoveListener(OnCameraLive);
    26.             if (connect)
    27.                 vcam.m_Transitions.m_OnCameraLive.AddListener(OnCameraLive);
    28.         }
    29.         var freeLook = vcamBase as CinemachineFreeLook;
    30.         if (freeLook != null)
    31.         {
    32.             freeLook.m_Transitions.m_OnCameraLive.RemoveListener(OnCameraLive);
    33.             if (connect)
    34.                 freeLook.m_Transitions.m_OnCameraLive.AddListener(OnCameraLive);
    35.         }
    36.     }
    37.  
    38.     void OnCameraLive(ICinemachineCamera vcamIn, ICinemachineCamera vcamOut)
    39.     {
    40.         enabled = true;
    41.     }
    42.  
    43.     void Update()
    44.     {
    45.         var brain = CinemachineCore.Instance.FindPotentialTargetBrain(vcamBase);
    46.         if (brain == null)
    47.             enabled = false;
    48.         else if (!brain.IsBlending)
    49.         {
    50.             if (brain.IsLive(vcamBase))
    51.                 OnBlendFinished.Invoke(vcamBase);
    52.             enabled = false;
    53.         }
    54.     }
    55. }
    56.  
    You can use a similar strategy to put a companion script on the Brain that wakes up when a blend is started and polls until the blend is finished, at which time it fires an event and goes back to sleep. That way you have a global event fired instead of a vcam-specific one.
     
    Last edited: Dec 4, 2019
  8. mjc33

    mjc33

    Joined:
    Oct 9, 2019
    Posts:
    26
    If anyone is looking for a shortish snippet you can use in existing code, this works with default blends:
    Code (CSharp):
    1.     public Cinemachine.CinemachineVirtualCamera[] cameras;
    2.     private int cameraCurrent;
    3.  
    4. ...
    5.  
    6.         var cameraLive = CinemachineCore.Instance.FindPotentialTargetBrain(cameras[cameraCurrent]);
    7.         float blendTime = cameraLive.m_DefaultBlend.m_Time;
    8.  
    9.         if (cameraCurrent == 1) {
    10.                 Invoke("ThatFunction", blendTime);        
    11.         }
    12.  
    13.         if (cameraCurrent == 3 || cameraCurrent == 5) {
    14.                 Invoke("TheOtherFunction", blendTime);        
    15.         }
    16.  
    17. ..
    18.  
    19.     private void ThatFunction()
    20.     {
    21.         // Do Stuff
    22.     }
    23.  
    24.     private void TheOtherFunction()
    25.     {
    26.         // Do Stuff
    27.     }
     
    MaximilianPs likes this.
  9. bruceweir1

    bruceweir1

    Joined:
    Nov 29, 2017
    Posts:
    15
    Another option that fires a global event when the Brain starts and finishes a blend. Put the script on the same GameObject as the CinemachineBrain component.

    Code (CSharp):
    1. using UnityEngine;
    2. using Cinemachine;
    3.  
    4. [RequireComponent(typeof(CinemachineBrain))]
    5.  
    6. public class CheckForCameraBlending : MonoBehaviour
    7. {
    8.     public delegate void CameraBlendStarted();
    9.     public static event CameraBlendStarted onCameraBlendStarted;
    10.  
    11.     public delegate void CameraBlendFinished();
    12.     public static event CameraBlendFinished onCameraBlendFinished;
    13.  
    14.  
    15.     private CinemachineBrain cineMachineBrain;
    16.  
    17.     private bool wasBlendingLastFrame;
    18.  
    19.     void Awake()
    20.     {
    21.         cineMachineBrain = GetComponent<CinemachineBrain>();
    22.     }
    23.     void Start()
    24.     {
    25.         wasBlendingLastFrame = false;
    26.     }
    27.  
    28.     void Update()
    29.     {
    30.         if (cineMachineBrain.IsBlending)
    31.         {
    32.             if (!wasBlendingLastFrame)
    33.             {
    34.                 if (onCameraBlendStarted != null)
    35.                 {
    36.                     onCameraBlendStarted();
    37.                 }
    38.             }
    39.  
    40.             wasBlendingLastFrame = true;
    41.         }
    42.         else
    43.         {
    44.             if (wasBlendingLastFrame)
    45.             {
    46.                 if (onCameraBlendFinished != null)
    47.                 {
    48.                     onCameraBlendFinished();
    49.                 }
    50.                 wasBlendingLastFrame = false;
    51.             }
    52.         }
    53.     }
    54. }
    55.  
     
    Last edited: Nov 3, 2020
  10. homemacai

    homemacai

    Joined:
    Jul 22, 2020
    Posts:
    74
    Thanks for this!
     
  11. gabagpereira

    gabagpereira

    Joined:
    Jan 21, 2019
    Posts:
    24
    I mean, is it so hard to implement this as a core feature of the package, especially after all these years??
     
  12. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    +1 for this. I'm needing to do a "Slow mo" effect by decreasing the timescale for when the blend completes. I can't do it before otherwise the blend will slow down...
     
    forteller likes this.
  13. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,723
    CinemachinBrain has an Ignore Time Scale option. When it's set, blends will happen in realtime, regardless of time scale.
     
    sincerelysleepy likes this.
  14. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    Hello there,in a version of cinemachine i found a onCamlive event which will fire as soon as the blend starts to new cmvcam
    But we need a special situation where the event should fire only and only when the transition has finished and completed and user has the full control of the current cvcam
    I will appreciate if you can help me on this one
     
  15. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    Thank you! This is fantastic.
     
  16. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,723
    You have the answer in the post above: https://forum.unity.com/threads/oncameratransition-onblendcomplete-event.520056/#post-3410572
    When your script has detected that the blend is completer, fire a new event.
     
  17. lolerji

    lolerji

    Joined:
    Jan 7, 2016
    Posts:
    19
    If blend is a behaviour of Cinemachine, Cinemachine itself should notify Start/End of blend. Currently it notifies start, but not the end. If notifying for blend end is as straight forward as "Start polling for blend end on target brain when a blend starts.", why is this event not provided by Cinemachine by default? Seems to me like we are forced to implement an API that should already be there to begin with.
     
  18. ProudPumPkin99

    ProudPumPkin99

    Joined:
    Jun 24, 2021
    Posts:
    1
    I encountered same problem. I needed something on blend complete.. couldn't find anything so I wrote following script. This isn't the best solution out there but is understandable.
    Code (CSharp):
    1. using UnityEngine;
    2. using Cinemachine;
    3. using System.Collections;
    4.  
    5. public class Test : MonoBehaviour
    6. {
    7.     //In Case you wanna call different fucntions at the end of blend as per need.
    8.     delegate void Delegate();
    9.     Delegate onCompleteBlend;
    10.  
    11.     //cinemachine virtual cameras
    12.     public Transform cam1, cam2;
    13.     private Transform currentActiveCam;
    14.  
    15.     void Awake()
    16.     {
    17.         //cam1 already has its priority set to 1 and all other cameras have 0 priority.
    18.         currentActiveCam = cam1;
    19.     }
    20.  
    21.     public void Start()
    22.     {
    23.         //Calling from here
    24.         SwitchToCamera(cam2);
    25.  
    26.         //assign this
    27.         onCompleteBlend = Func1;
    28.         //or this
    29.         //onCompleteBlend = Func2;
    30.  
    31.         StartCoroutine(WaitForCinemachineBlend());
    32.     }
    33.  
    34.     IEnumerator WaitForCinemachineBlend()
    35.     {
    36.         yield return new WaitForEndOfFrame();
    37.         if (GetComponent<CinemachineBrain>().IsBlending)        //script and brain attached to same GameObject
    38.             StartCoroutine(WaitForCinemachineBlend());
    39.         else
    40.             onCompleteBlend();
    41.     }
    42.  
    43.     //switching to another virtual camera
    44.     public void SwitchToCamera(Transform cam)
    45.     {
    46.         currentActiveCam.GetComponent<CinemachineVirtualCamera>().Priority = 0;
    47.         currentActiveCam = cam;
    48.         currentActiveCam.GetComponent<CinemachineVirtualCamera>().Priority = 1;
    49.     }
    50.  
    51.     void Func1()
    52.     {
    53.         //do something after the blend
    54.         Debug.LogError("Implementing Func 1");
    55.     }
    56.  
    57.     void Func2()
    58.     {
    59.         //do something else after the blend
    60.         Debug.LogError("Implementing Func 2");
    61.     }
    62. }
     
  19. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    This really needs fixing in CineMachine. Getting these events to work is a bunch of trial and error and hacking around CineMachine to add what should be there from the start as @gabagpereira pointed out.

    e.g. I needed:
    1. Camera has finished blending in
    2. Camera will start blending out
    To get that, I had to:
    • Take @Gregoryl 's script (to get 'finished blend in')
    • Try to add code to hook the brain's m_CameraActivatedEvent and use it to detect when this vcam is being replaced (since there's no direct equivalent to Gregroyl's call for vcam going away, only for it coming in)
    • ...Discover that this doesn't work, seems that current CineMachine has a nasty behaviour in event ordering: when you're reacting to vcam's m_OnCameraLive and then additionally register to brain's m_CameraActivatedEvent ... the brain event (which triggered the vcam event) falsely triggers AFTER the vcam event (events shouldn't be re-entrant like this, that's nasty design)
    • Modify it so that waits until blending-in (Gregoryl's script) has fniished and only at that moment, in that frame, register with the brain to find out when the vcam changes again

    All of which should have been built-in to CineMachine, and would have avoided wasting time discovering internal details of CM's event-ordering (which IMHO is wrongly ordered right now - an event that subscribes to the cause of that event should not be re-triggering off itself in the same frame).

    i.e. this code shouldn't go wrong:

    Code (CSharp):
    1. void OnCameraLive(ICinemachineCamera vcamIn, ICinemachineCamera vcamOut)
    2.     {
    3.         Debug.Log( "My cam started blend, changing: "+vcamOut+" -> "+vcamIn );
    4.         enabled = true;
    5.         OnAnimateInStarted.Invoke( vcamIn as CinemachineVirtualCameraBase );
    6.  
    7.         var brain = CinemachineCore.Instance.FindPotentialTargetBrain( vcamIn as CinemachineVirtualCameraBase );
    8.         brain.m_CameraActivatedEvent.AddListener( CameraWillAnimateOut );
    9. // the above event SHOULD NOT FIRE in this same frame, but it does - even though its already fired
    10.     }
    NB: I might have made some stupid mistake in the above - if so: even more reason this should be implemented inside CineMachine! - but once I made the change I described above it worked fine, so in principle it seems correct.
     
  20. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,723
    @a436t4ataf I feel your frustration. The reason CM doesn't implement these events as a core feature is that blending can get complicated: blends can nest, they can be generated form places other than the brain. We'd have to support all the strange ways that people might be using CM. This thread is about a straightforward situation: notifications for top-level blend in and out on the brain. Since it is so easy to implement this, we leave it to the user rather than having to design for and support all sorts of weird cases.

    As for the event ordering, yes it might seem unexpected that the global camera change event is fired after the camera-local one, but the events have to come in some order. I don't see a strong reason for it to be one way rather than the other. For the record, the events are not re-entrant; they are fired one after the other.

    For your specific use case, I would implement a global script that monitors brain blends, as @bruceweir1 did above. Let it expose the desired events, e.g.:
    • OnBlendStarted(brain, incomingCam, outgoingCam)
    • OnBlendFinished(brain, incomingCam, outgoingCam)
    Your vcam-specific script can then register handlers for those, and check whether one of the cams is itself, and react accordingly.
     
    Last edited: Mar 18, 2023
  21. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    Sure, but that complexity is why it *needs* to be provided by CM. CM's architecture defines what is/isn't possible in blending - if it's too complex for CM to implement consistent events then that's a strong sign that CM's definition of blending is incomplete, is missing some expressivity that would enable CM to programmatically determine what is going on and what it means.

    TL;DR: if CM can't confidently know what's happening, how can it confidently implement it correctly?

    Re: events - I would say that the standard for UnityEvents is to isolate dispatch, so that if you plan to dispatch the same event twice you freeze the listener-lists. In basic cases no-one should be double-dispatching an event, and so .Invoke(..) works fine and we don't need to worry about it. But if you have a design reason to double-dispatch (as here in CM), then the burden becomes on CM to do this properly and make sure that the set of listeners receiving the second copy of the event cannot be modified by the handlers to the first copy of it.

    Although if it were me, I'd probably instead invest the time to improve the design of these events inside CM, such that this never happens (and in the rare cases that it does, I'd have a LogWarning or even an Exception - ConcurrentModificationException for instance, which is lazy (its not really an error, but at least it signals 'CM should handle this but we didn't write the code to handle it, so until we change the code, this is effectively an error')) -- the API for local-camera events is screamingly obviously only partially written, and if it had the obvious simple essential calls this wouldn't be an issue in practice.
     
  22. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,723
    Hey thanks for taking the time to write this up. I'm not sure I entirely understand your remarks, though.

    Multiple dispatch: CM doesn't send the same event multiple times, or at least not exactly. When a camera gets activated, an event is sent out, but it is sent out to 3 different sets of listeners:
    1. Global
    2. Per-brain in which the camera is live
    3. The camera itself
    If the handlers of those events want to manipulate the listener lists, they can do that, but they need to take care. I'm not convinced that it's up to CM to prevent or manage this.

    Or, are you suggesting that the events should be collected and sorted, so that all the global events are sent, then all the per-brain ones, then all the per-camera ones?

    I can think of a couple of other possible changes to make:
    1. Have only global events. Let the handlers filter by brain or camera if they want to. The downside is that it makes it harder to set up prefabs with their events pre-wired.
    2. Send out events only for cameras that are actually live (i.e. contributing to the main camera's final output). No events if a blend happens for cameras that are mixed out at some intermediate level (e.g. by a mixing camera or state-driven camera or timeline).

    What do you think?
     
  23. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    All good suggestions. I know some of your use-cases (I've built and maintained multi-camera setups both in Unity and in other engines), so I can make some educated guesses - but my feedback here is necessarily restricted to the use-cases I'm aware of. I don't want to accidentally exclude someone else's cases!

    With that in mind, though, I can make some general comments:

    • Global-only events should be sufficient for almost everything, so long as they include the context of which Brain fired them, and so long as there's no performance hit. For CM use-cases, I believe the number of events will always be extremely small compared to Unity's general performance, so 'performance hit' should never be a concern here (if you're doing more than a small number of camera changes per frame, the player would probably get motion sickness anyway ;))
    • Per-brain events should be trivial for us developers to simulate given the above - it's trivial to have our callback methods do a 'switch' (or even an 'if') on the Brain that was passed-in as a param ... for the cases where we actually want to limit it. So there shouldn't (in general) be a need to have per-brain events separately (I think, but modulo my point at the start: I might be missing a use-case where this isn't true)
    • The correct granularity is definitely one of the above - it's either per-brain, or global - because Vcams in general are many in number, and are (by design) NOT responsble for / aware of what else is happening in the scene. That means in general that no individual camera will ever have enough context for the callbacks to work well (except for simple/trivial cases)
    • ... the prefabs issue would be a reason for 'additionally' having per-camera, with a note in the docs to say 'in general use the global/per-brain ones instead' ... but the way CM's core design works we (as end-users) should be avoiding doing anything coupled too tightly to the individual vcams.
    • ... I would like to see what some of the known use-cases are for these prefabs - what kind of thing are people pre-wiring to a specific vcam? It sounds like the kind of thing I should be avoiding (see above point), so ... when is it a good idea?
    • A simple param (or macro-like method) for 'is this camera contributing to the blend right now?' is necessary in general. This is true for ALL features of CM that are 'dynamic/evaluated/calculated': in general, we're happy to have a 'Black Box' of functionality (e.g. we *want* CM to handle all the blending automagically, using the info we gave on custom vcam/vcam blends, the current set of prioritized vcams, etc etc) -- but we often need to know 'OK, fine -- but RIGTH NOW IN THIS FRAME what's the current output / outcome / status of that blackbox?'
     
  24. gabagpereira

    gabagpereira

    Joined:
    Jan 21, 2019
    Posts:
    24
    If you want to avoid making constant checks through the Update method, just use a Coroutine. But don't forget that blends can be interrupted halfway through, so it's important to account for that scenario as well.

    Here is a simple script that you can attach directly to the CinemachineBrain and modify to suit your needs:
    Code (CSharp):
    1. using Cinemachine;
    2. using System.Collections;
    3. using UnityEngine;
    4. using UnityEngine.Events;
    5.  
    6. [RequireComponent(typeof(CinemachineBrain))]
    7. public class CameraBrainEventsHandler : MonoBehaviour
    8. {
    9.     public event UnityAction<ICinemachineCamera> OnBlendStarted;
    10.     public event UnityAction<ICinemachineCamera> OnBlendFinished;
    11.  
    12.     CinemachineBrain _cmBrain;
    13.     Coroutine _trackingBlend;
    14.  
    15.     void Awake()
    16.     {
    17.         _cmBrain = GetComponent<CinemachineBrain>();
    18.         _cmBrain.m_CameraActivatedEvent.AddListener(OnCameraActivated);
    19.     }
    20.  
    21.     /// <summary>
    22.     /// Called by the <see cref="CinemachineBrain"/> when a camera blend is started.
    23.     /// </summary>
    24.     /// <param name="newCamera">The Cinemachine camera the brain is blending to.</param>
    25.     /// <param name="previousCamera">The Cinemachine camera the brain started blending from.</param>
    26.     void OnCameraActivated(ICinemachineCamera newCamera, ICinemachineCamera previousCamera)
    27.     {
    28.         Debug.Log($"Blending from {previousCamera.Name} to {newCamera.Name}");
    29.  
    30.         if (_trackingBlend != null)
    31.             StopCoroutine(_trackingBlend);
    32.  
    33.         OnBlendStarted?.Invoke(previousCamera);
    34.         _trackingBlend = StartCoroutine(WaitForBlendCompletion());
    35.  
    36.         IEnumerator WaitForBlendCompletion()
    37.         {
    38.             while (_cmBrain.IsBlending)
    39.             {
    40.                 yield return null;
    41.             }
    42.  
    43.             OnBlendFinished?.Invoke(newCamera);
    44.             _trackingBlend = null;
    45.         }
    46.     }
    47. }
     
  25. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,723
    @a436t4ataf Thanks for your great feedback. I think CM3's approach to events - to be published in the next pre-release - will address pretty much all of your issues. There are global CameraActivated/Deactivated events, as well as BlendFinished events. There are also optional "events" behaviours that can be added to cameras or brains, which monitor the global events and filter for the attached object, making it easy to get per-brain or per-camera events if desired. Appropriate context is provided in all cases.

    Currently in CM2 you have CinemachineCore.Instance.IsLive(vcam), which answers the question: is this vcam contributing to a camera output right now.
     
    Last edited: Mar 29, 2023
    Meatloaf4 and a436t4ataf like this.
  26. ctronc

    ctronc

    Joined:
    May 18, 2017
    Posts:
    19
    Just got this as my first result on a Google search on how to be notified when a camera blend ends. This is working for me, it should work correctly as long as you only have one virtual camera transition going on.

    Create a CameraBlendMonitor.cs script and paste the following. The script should be attached to the same GameObject where CineMachineBrain is (a common scenario is attaching it to the main camera):

    Code (CSharp):
    1. using UnityEngine;
    2. using Cinemachine;
    3.  
    4. public class CameraBlendMonitor : MonoBehaviour
    5. {
    6.     private CinemachineBrain _brain;
    7.     private bool _isBlending = false;
    8.  
    9.     void Start()
    10.     {
    11.         _brain = GetComponent<CinemachineBrain>();
    12.     }
    13.  
    14.     void Update()
    15.     {
    16.         if (_brain.IsBlending)
    17.         {
    18.             _isBlending = true;
    19.         }
    20.         else if (!_brain.IsBlending && _isBlending)
    21.         {
    22.             _isBlending = false;
    23.             Debug.Log("Blend completed");
    24.             // Call your function or trigger your event here
    25.         }
    26.     }
    27. }
     
  27. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    That appears identical (but worse in every way - less accurate, adds bugs) to what was posted almost 4 years ago. Why did you post it?
     
  28. GameTrackStudio

    GameTrackStudio

    Joined:
    Mar 31, 2020
    Posts:
    3
    I am also Looking for a Solution for blending between Culling Mask in Main Camera when Virtual Cam is enabled , just like perspective override Cinemachine virtual Camera should also have culling mask Override and also Clear Flags Override if Possible , it will make it Easy for us.

    upload_2023-6-18_2-29-25.png
    This Kind of Setting Aren't Available in Cinemachine VCam , there should be a Way to Override , just like Perspective Override Here :

    upload_2023-6-18_2-28-57.png
     
  29. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,723
    You can do it with a custom script that overrides whatever you like in OnEnable and puts it back in OnDisable. Note that this particular setting won't blend, so you'll have to work with that limitation.