Search Unity

Camera Selection: Priority System vs. Activating / Deactivating

Discussion in 'Cinemachine' started by eV-Interactive, Jun 26, 2020.

  1. eV-Interactive

    eV-Interactive

    Joined:
    Oct 25, 2016
    Posts:
    41
    First, thanks for Cinemachine!. I had rolled my own virtual camera system with morphing but, obviously, nice to have this in somebody else's hands now ;-)

    So, in the interest of performance, I used the "deactivate virtual cameras" method to switch cameras in Cinemachine. Understandably, adding a noise function to the virtual cameras results in a discontinuity when you disable camera A, and cause the system to slew to camera B.
    • Is there any sneaky way around this, or should I switch via priorities?
    • Are the virtual cameras "smart enough" to skip some processing when they are no longer a factor in a morph?
    • If not, should I just set up a timer and disable the previous camera after the morph is done?
    Thanks for any advice!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    What you say "adding a noise function", what do you mean? If you use CM's noise or impulse, then there should be no discontinuity, even if you deactivate the vcams (don't disable the behaviour, just deactivate the whole vcam. CM will put it onto artificial life-support until the blend is finished).
     
  3. eV-Interactive

    eV-Interactive

    Joined:
    Oct 25, 2016
    Posts:
    41
    Thanks... Yes, I enabled a "Basic Multi Channel Perlin" noise on all of my VirtualCameras.

    So, I tried disabling just the CinemachineVirtualCamera components vs. the entire GameObject they are on, and I see the same discontinuity. It "feels" like the noise from the "former" camera isn't being factored into the blend to the "new" camera.
     
  4. eV-Interactive

    eV-Interactive

    Joined:
    Oct 25, 2016
    Posts:
    41
    FWIW: I'm getting the sense that the noise function is reset when the component is disabled/enabled and that may be causing the discontinuity.
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Deactivating the whole game object is the right way to do this. There should be no glitch. Maybe you're using an old version of Cinemachine? Try upgrading to the latest 2.6.0.