Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Camera Selection: Priority System vs. Activating / Deactivating

Discussion in 'Cinemachine' started by eVPublishing, Jun 26, 2020.

  1. eVPublishing

    eVPublishing

    Joined:
    Oct 25, 2016
    Posts:
    14
    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:
    3,811
    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. eVPublishing

    eVPublishing

    Joined:
    Oct 25, 2016
    Posts:
    14
    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. eVPublishing

    eVPublishing

    Joined:
    Oct 25, 2016
    Posts:
    14
    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:
    3,811
    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.
     
unityunity