Search Unity

Null Reference Exception when deleting a virtual camera

Discussion in 'Cinemachine' started by TheValar, Dec 12, 2018.

  1. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Pretty easy to repro this

    I have a scene with a cinemachine brain and a single virtual camera. If I duplicate that virtual camera the new one will take priority as it should.

    deactivating the new virtual camera will cause priority to return to the original as expected, but if the new one is deleted I will get a null reference exception every frame forevermore. Seems like destroying a virtual camera should have the same effect as deactivating it

    CinemachineNullReferenceException.png
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    Yes, this is a known issue and has been fixed in the upcoming CM 2.2.8
     
    TheValar likes this.