Search Unity

Bug Null 'UniversalAdditionalCameraData' in VolumeDebugSettings.cs

Discussion in 'Universal Render Pipeline' started by slippyfrog, May 26, 2022.

  1. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    42
    Hello and thanks for the help/insight in advance!

    I just upgraded to Unity 2022.1.1f1 and experienced the following Exception in UnityEngine.Rendering.DebugDisplaySettingsVolume. The issue is reproducible 100% within my project.

    Thanks!!

    Repo Steps:
    1. Load project
    2. Run game by pressing play button
    3. Stop game by pressing stop button

    Observed the following exception upon the play mode stopping:
    • MissingReferenceException: The object of type 'UniversalAdditionalCameraData' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object.
    • In the Unity Scene View, objects no longer render as a result of the exception.
    • This exception now throws constantly in the Unity Editor and the Unity editor must be force-quit-and-restarted for the error to go away.

    Notes:
    It appears that there is a null entry in the additionalCameraDatas list of the VolumeDebugSettings class. This can be seen here:

    upload_2022-5-26_9-28-53.png

    Unity 2022.1 is unusable for me unit I can resolve this. My feeling is that this is a URP bug, thought it could be manifested by some unexpected configuration in my camera rig, or me accidentally clearing some sort of delegate by accident some where in my code. I did look over my stuff and it is pretty straight forward. I do make heavy use of multiple cameras and additive scenes.

    My project is quite large 10Gigs so it may be hard to boil down a project that can reproduce this or upload a project file. Please advise if you feel this is a bug and how I should proceed, or if anyone has experienced/worked around this



    Expected
    Unity should not enter and inoperable state due.


    Project Environment:
    Unity 2022.1.1f1
    Mac OSX 11.4
    URP 13.1.8

    Stack:
    Code (CSharp):
    1. MissingReferenceException: The object of type 'UniversalAdditionalCameraData' has been destroyed but you are still trying to access it.
    2. Your script should either check if it is null or you should not destroy the object.
    3. UnityEngine.Component.GetComponent[T] () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/Component.bindings.cs:42)
    4. UnityEngine.Rendering.VolumeDebugSettings`1+<get_cameras>d__11[T].MoveNext () (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/VolumeDebugSettings.cs:64)
    5. UnityEngine.Rendering.DebugDisplaySettingsVolume+WidgetFactory.CreateCameraSelector (UnityEngine.Rendering.DebugDisplaySettingsVolume data, System.Action`2[T1,T2] refresh) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsVolumes.cs:87)
    6. UnityEngine.Rendering.DebugDisplaySettingsVolume+SettingsPanel..ctor (UnityEngine.Rendering.DebugDisplaySettingsVolume data) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsVolumes.cs:358)
    7. UnityEngine.Rendering.DebugDisplaySettingsVolume.CreatePanel () (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsVolumes.cs:394)
    8. UnityEngine.Rendering.DebugDisplaySettingsUI+<>c__DisplayClass3_0.<RegisterDebug>b__0 (UnityEngine.Rendering.IDebugDisplaySettingsData data) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsUI.cs:36)
    9. UnityEngine.Rendering.DebugDisplaySettings`1[T].ForEach (System.Action`1[T] onExecute) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettings.cs:90)
    10. UnityEngine.Rendering.DebugDisplaySettingsUI.RegisterDebug (UnityEngine.Rendering.IDebugDisplaySettings settings) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsUI.cs:47)
    11. UnityEngine.Rendering.Universal.UniversalRenderPipeline..ctor (UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset asset) (at Library/PackageCache/com.unity.render-pipelines.universal@13.1.8/Runtime/UniversalRenderPipeline.cs:191)
    12. UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset.CreatePipeline () (at Library/PackageCache/com.unity.render-pipelines.universal@13.1.8/Runtime/Data/UniversalRenderPipelineAsset.cs:384)
    13. UnityEngine.Rendering.RenderPipelineAsset.InternalCreatePipeline () (at /Users/bokken/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipelineAsset.cs:10)
    14. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
    15.  
     
    Last edited: May 26, 2022
    trombonaut and samanabo like this.
  2. samanabo

    samanabo

    Joined:
    Mar 10, 2015
    Posts:
    51
    I have also been seeing this issue intermittently in Unity 2022.1.2f1.
    Seems like a fairly big issue to me since the scene and game views becomes unusable unless you do a full restart of the editor.
    Any insight is much appreciated.
     
  3. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    42
    Thanks for replying @samanabo and sorry to hear this is manifesting for you as well and it is not just me.

    I've since tired to isolate the issue by stripping my project. It happens at quite a high frequency but I am finding it hard to narrow down a deterministic reproduction step. I notice it on the first few times I press play of a freshly loaded project.

    forcing a domain reload on play seems to allow the editor to self correct. The additionalCamera list is probably not serialized so it is reset to a new instance on reload. This isn't a proper fix though as the editor is still non functional in-between plays and we need the fast iteration time of PlayModeOptions.

    I figure something in my code could be worked around to try to avoid the issue until it is fixed properly in URP. lots of non-empirical observations but nothing concrete:

    At first, i thought it could have to do with explicit calls from my code to GetUniversalAdditionalCameraData from he camera class. when GetUniversalAdditionalCameraData is called, an instance of GetUniversalAdditionalCameraData is enabled causing it to register with the UniversalRenderPipelineVolumeDebugSettings. the camera is properly removed when the OnDisable is called, however if the camera is Destroyed before the onDisable is called, then the a null entry could now be in the additionaCameraDatas list if additionalCameraDatas.Contains fails in UnRegisterCamera.

    Commenting all calls to GetUniversalAdditionalCameraData seemed to fix the issue... or at least reduce the frequency of the issue. I was unable to replicate/isolate the issue in a new project so perhaps there are more things that are causing the issue in combination.

    I tried to see if the null instance was the Main camera or the Scene View camera that was nulled. The debugger did not give me good insight into if the null inside the aditionalCameras list used to be the Scene View camera or the Main Camera. I deleted the Main Camera from my scene and pressed play to observer thet the issue was still manifesting. also When I hide the Scene View (be placing it as an inactive-tab (placed the tab. under the game tab as seen in the pic below), and pressed play, the issue would Not manifest. From these, I think I can inferm that the Scene View Camera is destroyed at some point before it can be properly removed from the additionalCameras List. Not sure if the Scene View camera is destroyed/recreated on play start/stops or whatever.

    upload_2022-6-3_11-10-2.png
    From what I recall, hiding the scene view before the editor enters play mode seems to fix the issue.

    Again not conclusive and I was unable to isolate deterministic reproduction steps and unable get a solid work around. For now Im sticking to unity 2021.3.LTS. I would like to use the Tech stream as my game isn't releasing until next year. I was hoping that 2022 solves or eventually solves some of the Reload Assemblies iteration time issues as Reload Assembiles stacks 6-8s on each recompile of our project.

    Anyways I hope the URP team sees this and can commit or provide some insight into a work around or if this is a bug vs data/project configuration issue.


    Code (CSharp):
    1.      
    2. cass UniversalAdditionalCameraData
    3. {
    4.   void RegisterDebug()
    5.         {
    6.             if (!m_IsDebugRegistered)
    7.             {
    8.                 UniversalRenderPipelineVolumeDebugSettings.RegisterCamera(this);
    9.                 m_IsDebugRegistered = true;
    10.             }
    11.         }
    12.  
    13.         void UnRegisterDebug()
    14.         {
    15.             if (m_IsDebugRegistered)
    16.             {
    17.                 UniversalRenderPipelineVolumeDebugSettings.UnRegisterCamera(this);
    18.                 m_IsDebugRegistered = false;
    19.             }
    20.         }
    21. }
    22.  
    23.  
    24. class VolumeDebugSettings
    25. {
    26. [INDENT]/// <summary>
    27. /// Register the camera for the Volume Debug.
    28. /// </summary>
    29. /// <param name="additionalCamera">The AdditionalCameraData of the camera to be registered.</param>
    30. public static void RegisterCamera(T additionalCamera)
    31. {
    32.     if (!additionalCameraDatas.Contains(additionalCamera))
    33.         additionalCameraDatas.Add(additionalCamera);
    34. }
    35.  
    36. /// <summary>
    37. /// Unregister the camera for the Volume Debug.
    38. /// </summary>
    39. /// <param name="additionalCamera">The AdditionalCameraData of the camera to be registered.</param>
    40. public static void UnRegisterCamera(T additionalCamera)
    41. {
    42.     if (additionalCameraDatas.Contains(additionalCamera))
    43.         additionalCameraDatas.Remove(additionalCamera);
    44.  
    45. }[/INDENT]
    46. }
    47.  
     
    samanabo likes this.
  4. Somnesis

    Somnesis

    Joined:
    Feb 27, 2020
    Posts:
    32
    I'm getting the exact same thing.

    Unity 2022.1.3 Apple Silicon
    URP 13.1.8
    macOS 12.3.1

    Curious to see that @slippyfrog is also on a Mac. Maybe it's a Mac issue? @samanabo are you also on a Mac? And running Apple Silicon?

    Has anyone filed a bug with Unity yet?
     
    ETGgames and samanabo like this.
  5. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    42
    @Somnesis Thanks for chiming in but sorry to hear you are getting this too. I was really looking forward to migrating to 2022 but this is a blocker.

    Im happy to file a bug for in the next few days and can probably strip down a project that they can repo the issue with.

    I'm running on an iMac with i7 processor and not that fancy Apple Silicon stuff :)

    It could very well be a Mac issue as maybe that's why we are not seeing more people report the issue.

    Are you guys using Highlight Plus (asset by Kronnect). That asset seem to do some custom render pass stuff and but is well written. I thought the issue could have perhaps been caused by something going on in there as it does invoke GetUniversalAdditionalCameraData which triggers camera being added to the additionalCamera list.
     
    Last edited: Jun 4, 2022
    samanabo likes this.
  6. samanabo

    samanabo

    Joined:
    Mar 10, 2015
    Posts:
    51
    I AM using a mac as well, but not Apple Silicon.
    I'm not using Highlight Plus, and I have not filed a bug report since I cannot consistently reproduce it.
    I'd be happy to test anything out.. or look into it more if there are any ideas on how...
     
    slippyfrog likes this.
  7. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    42
    Thanks for the additional info @samanabo

    I checked out and ran my project on a Win 11 machine running Unity 2022.1.4 with URP 13.1.X and observer the null UniversalAdditionalCameraData issue. As such, this issue is not specific to Mac OS and can be confirmed as a universal defect.

    I'm surprised not more people have encountered this. Moving to Unity 2022.1.X isn't a huge priority for me right now, but I'll look to submit a stripped down project with a bug report over the next little but when I get chance. If any one would rather file a bug report sooner, just let me know on this thread so I don't double post.
     
    dudleyhk and samanabo like this.
  8. Somnesis

    Somnesis

    Joined:
    Feb 27, 2020
    Posts:
    32
    I am using highlight plus and we also have our own custom render feature for our own shader.

    @samanabo do you have any render features enabled in your URP renderer?

    And @slippyfrog do you have any other render features besides highlight plus?

    Maybe the bug has to do with having custom render features. Though that would be the entire point of URP, so that feature should work :D
     
  9. Somnesis

    Somnesis

    Joined:
    Feb 27, 2020
    Posts:
    32
    Okay so I removed the reference to GetUniversalAdditionalCameraData() in HighlightPlus and now the error is gone! So that was definitely the culprit for me :)
     
  10. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    42
    @Somnesis

    Fantastic! Glad the workaround works for you, but does that mean that HighlightPlus is not working correctly now? :)



    I feel like the culprit is GetUniversalAdditionalCameraData begin called from a custom render pass feature.
    I wasn't however able to isolate the issue by creating a new project with just URP and Highlight plus but I think I might try again.


    Highlight plus is pretty robust and widely used so I still feel this is a URP bug. Unfortunately I haven't had time to file this as a bug with Unity as I'm pretty swamped these days.

    If anyone gets a chance please feel free to file it!
     
  11. samanabo

    samanabo

    Joined:
    Mar 10, 2015
    Posts:
    51
    I'm using the 2D renderer with no custom renderer features.
    I do have post processing enabled, and I have the "Camera Sorting Layer Texture" enabled.
    Based on the errors shown, my best guess is an issue with post processing but I'm not really sure. Happy to look into any part of this.

    It seems like I am able to make the error occur when the game view is set to "maximize". If I take the following steps I can reproduce it consistently:
    1. Set the game view to maximize
    2. Start playing the game
    3. Right click on the game view tab and un-maximize
    4. Stop playing the game
    5. Start playing the game again
    6. Observe the game view and scene view are blank and the error occurs
     
  12. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    I get the same error and it's clearly the scene camera. When stopping the player it seems to not properly unregister itself.
     
    trombonaut likes this.
  13. meckzqz

    meckzqz

    Joined:
    Jul 2, 2017
    Posts:
    2
    Experiencing the same issue here. Very frustrating.

    Using Unity 2022.1.8f1, using URP, and also using a single custom (albeit basic) ScriptableRenderPass.
     
    Last edited: Jul 20, 2022
  14. oakus

    oakus

    Joined:
    Dec 27, 2012
    Posts:
    15
    Same thing happening to our team. 2D renderer, no customization, medium sized project, some plugins but nothing that would obviously manipulate URP. 2022.1.7f
     
    Last edited: Jul 27, 2022
  15. jantjedetweede

    jantjedetweede

    Joined:
    Oct 21, 2021
    Posts:
    7
    Same issue, anyone found a workaround?
     
  16. AtlinxNet

    AtlinxNet

    Joined:
    Feb 25, 2017
    Posts:
    7
    This also happened to me after updating a 2021 project to 2022.1.11f1. For me, I get a
    "MissingReferenceException: The object of type 'UniversalAdditionalCameraData' has been destroyed but you are still trying to access it."
    constantly spamming the editor whenever I have a scene open. I'd love to know if anyone's found a fix.

    EDIT: It's fixed if I turn on Domain Reloading in my editor settings. However, I had this option turned off to let me iterate on my game faster within the editor. Now I'd have to slog through 10-20 seconds of load time whenever I want to run my game. I'm switching back to 2021 for now until this issue is fixed.
     
    Last edited: Jul 30, 2022
    trombonaut likes this.
  17. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    42
    @Atlinux Yeah Domain Reload will force Unity to fix itself by clearing the members with corrupt entries.

    Reflection time is severely impacted by this and 10-20 seconds load-on-play is not a viable workflow. I decided to stay on 2021.3.X until this issue is fixed because its just too much to work around.

    This is defiantly an issue with the URP but Unity guys have not chimed in and I'm a bit too busy to file a bug and I'm find working with 2021.3.X for the foreseeable future.

    As a work around, could you force domain reload when exiting-out-of-play-mode? Its still a long pause for the editor, but for me I usually jump back into the ide/code as soon as I stop play. Could you also have a button that triggers RequestScrptReload so you can manually call it. its not great but better than nothing.

    https://docs.unity3d.com/ScriptReference/EditorUtility.RequestScriptReload.html

    Alternatively, you might be able to clear the list with the null entry through reflection (I think we can grab the handle the the instances with the list that has the null camera data entry). its also ugly but it could potentially avoid a domain reload -- assuming the rest of the data is not in an indeterminate state.
     
    Last edited: Aug 1, 2022
    trombonaut likes this.
  18. samanabo

    samanabo

    Joined:
    Mar 10, 2015
    Posts:
    51
    This still happens for me after updating to 2022.1.10f1 and I can generally reproduce the problem when I have the game view set to maximize, and while the game is running I right click and un-maximize the game view.

    As for a workaround, I took the suggestion from @slippyfrog and created the attached script to quickly reload the domain/scripts. It is far from ideal... but it does save you reloading the whole editor.
     

    Attached Files:

    trombonaut, F48i and --julian95-- like this.
  19. --julian95--

    --julian95--

    Joined:
    Nov 2, 2015
    Posts:
    6
    Same issue here on 2022.1.10f1.
     
  20. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    302
    As of today, on 2022.1.11f1 i am also getting this. just out of nowhere, was building in scene view hit play, then boom all gone, both scene and game camera not working until editor reboot.,
     
    MaxPirat likes this.
  21. Superduperkillen

    Superduperkillen

    Joined:
    Jul 12, 2017
    Posts:
    1
    Today this suddenly appeared out of nowhere (both on 2022.1.2f1 and 2022.1.11f1)

    In my case it only occurs if I switch scene while in play mode.
    Really annoying.
     
    MaxPirat likes this.
  22. Hafazeh

    Hafazeh

    Joined:
    Mar 26, 2017
    Posts:
    18
    the fix is turning on
    This is a temp FIX!

    Thank you for this! saved me some frustration.

    This is still present in 2022.1.13f1, come on guys. :(
     
  23. EmergoEntertainment

    EmergoEntertainment

    Joined:
    Oct 4, 2021
    Posts:
    5
    Wanted to chime in and note that this happens to us when searching for "CinemachineVirtualCamera" Components via the search function in the hierarchy. Version is 2022.1.8f1 on both windows & mac (intel)
     
  24. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    I encounter this issue more or less often because our main camera sits in an additively loaded scene which is bootstrapped when you start the playmode. We haven't entirely figured out the pattern but every so often as described above this breaks the scene and game view until the editor is restarted. Loading the camera scene before entering playmode prevents the bug often though. But it is still a very large nuisance, please fix :-/
     
  25. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    42
    @fleity great insight. thanks for sharing. My project also relies heavily on additive scenes that are loaded over the life cycle of the game by a bootstrapped scene. This is great insight into isolating the issue
     
  26. makaolachsiungca

    makaolachsiungca

    Joined:
    Sep 27, 2019
    Posts:
    31
    Hi all,
    Keep a camera in your scene,
    and add a script to set the gameObject of camera deactivate while Awake().

    No more null exception.
    Unity 2022.1.10f
    URP 13.1.8
     
    jeremedia and OhiraKyou like this.
  27. OldKing_Wang

    OldKing_Wang

    Joined:
    Jan 25, 2015
    Posts:
    46
    I have the same issue , even with empty scene (only one camera , nothing else)

    I try everything , but for now the only work around is replace the `PackageCache` `VolumeDebugSetting` file.



    Snipaste_2022-09-21_18-00-33.png Snipaste_2022-09-21_18-01-04.png
     
  28. jantjedetweede

    jantjedetweede

    Joined:
    Oct 21, 2021
    Posts:
    7
    This file resets every time I enter playmode
     
  29. OldKing_Wang

    OldKing_Wang

    Joined:
    Jan 25, 2015
    Posts:
    46
    you need find out where is the real "source file"

    I don't know how unity or Mac working with the "PackageCache" things.

    sometime A project Cache file point to B project Path. in that case , it will rest when you change the file.in A project (it will copy again from B project)
     
  30. studio-fizbin

    studio-fizbin

    Joined:
    Mar 3, 2013
    Posts:
    9
    Our whole studio is struggling with this issue. @OldKing_Wang fix helps us get through the day without having to restart the editor throught the whole day, so thanks a lot for rhat :)

    To everyone who encounters this issue:
    As @OldKing_Wang said you have to apply that null check into the VolumeDebugSettings.cs in the Unity RP Core Package. If you do it in the cache it will get reset as @jantjedetweede already said.

    For our unity version (2022.1.4f1) the core rp package that overwrites the cache in the project lies here:

    INSTALLLOCATION\2022.1.4f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.render-pipelines.core\Runtime\Debugging
     
  31. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
  32. randyleemaitland

    randyleemaitland

    Joined:
    Nov 25, 2020
    Posts:
    6
    i've been tinkering between pixel perfect cameras and perspective cameras removing the pixel perfect component switching all my confiners around, just being a slob, and after awhile, i get this error--usually when switching back to perspective...

    adding the line like OldKing says works, but I can get the error again, and have to quickly get the line back in the script or it will keep getting deleted.
     
  33. ETGgames

    ETGgames

    Joined:
    Jul 10, 2015
    Posts:
    101
    getting this issue on apple silicon. its getting really annoying now. tried upgrading unity but issue got worse it feels like....
     
  34. KimmoFactor

    KimmoFactor

    Joined:
    Dec 29, 2020
    Posts:
    39
    Bump. Just started getting this frequently too (2022.1.19f).
     
  35. Maximon9

    Maximon9

    Joined:
    May 26, 2022
    Posts:
    8
    I'm actually getting an issue quite like this.

    Here's the whole error:

    MissingReferenceException: The object of type 'UniversalAdditionalCameraData' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Component.GetComponent[T] () (at <d8d38b92d94a4ff8a91e61d39c6d19cd>:0)
    UnityEngine.Rendering.VolumeDebugSettings`1+<get_cameras>d__11[T].MoveNext () (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/VolumeDebugSettings.cs:64)
    UnityEngine.Rendering.DebugDisplaySettingsVolume+WidgetFactory.CreateCameraSelector (UnityEngine.Rendering.DebugDisplaySettingsVolume data, System.Action`2[T1,T2] refresh) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsVolumes.cs:87)
    UnityEngine.Rendering.DebugDisplaySettingsVolume+SettingsPanel..ctor (UnityEngine.Rendering.DebugDisplaySettingsVolume data) (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/DebugDisplaySettingsVolumes.cs:358)
    UnityEngine.Rendering.DebugDisplaySettingsVolume.CreatePanel () (at Library/PackageCache/com.unity.render-pipelines.core@13.1.8/Runtime/Debugging/De

    Except that my problem only happens when I try to build the game. When I'm entering play mode it's all fine but when I try to build the game, I get this error. Then my play mode screen goes black and I have to restart my editor. Not quite the same issue, but it's very closely related.
     
  36. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    This happens if I enter play with a prefab scene in edit mode. I have an editor button that forces a script reload which fixes it temporarily.
    EditorUtility.RequestScriptReload();

    If I close the prefab editing window and play, I dod not get the error.

    Unity 2022.1.18f on an M1 Mac
     
  37. ADNOC_LNG

    ADNOC_LNG

    Joined:
    Mar 7, 2021
    Posts:
    4
    What I did is double click on the error to open the script VolumeDebugSettings and I added this the line number 66:
    if(additionalCameraData !=null)

    That solved the problem for me!
    Please note that I have not tested this solution, so be careful and take backup :)
     
    trombonaut likes this.
  38. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    I want to point out that while this is the correct line of code you need to add double clicking the error takes you to the location of the file inside the package cache and typically the package cache is reset when unity detects a change. The place where you want to edit this is inside the install location of the editor inside the packages folder there.

    Sth. similar to this:
    Code (CSharp):
    1. C:\Program Files\Unity\2022.1.4f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.render-pipelines.core\Runtime\Debugging
     
    Reahreic likes this.
  39. Reahreic

    Reahreic

    Joined:
    Mar 23, 2011
    Posts:
    254
    Thank you for fixing what Unity appears incapable of.
     
  40. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Just hit this bug in 2022.1.22.

    Edit: I got an update from someone at Unity:

    "Just to update, this has been fixed in the 23.1 beta and there’s a ticket for the fix to be backported already"
     
    Last edited: Nov 11, 2022
    trombonaut and slippyfrog like this.
  41. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    42
  42. ChrissTman

    ChrissTman

    Joined:
    Aug 11, 2015
    Posts:
    10
    A temp fix for my project was to add a camera to the scene and destroy it on start.
    (The camera component has to be enabled as well)
    (It doesn't have to have the tag "Main Camera")


    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class ConsideringSwitchingToUnreal : MonoBehaviour
    4. {
    5.     void Awake()
    6.     {
    7.         Destroy(gameObject);
    8.     }
    9. }
    10.  
     
    Last edited: Dec 16, 2022
  43. Tim2021

    Tim2021

    Joined:
    Jan 19, 2021
    Posts:
    22
    We had the same problem. All of our cameras were being created at runtime and @ChrissTman 's temp fix seems to have "worked" for now. Thanks!
     
  44. mailfromthewilds

    mailfromthewilds

    Joined:
    Jan 31, 2020
    Posts:
    217
  45. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    42
    My message was to indicate that there was traction/line of sight on a resolution to the issue. More specifically, it looked like that Unity has resolved the issue and that it would be eventually be propagated once 2022.2.0aX was promoted into a release build.(ie 2022.2.1, etc). For those working on 2022.1.X, either they would have to work around or migrate to 2022.2.X once it was stable.

    2022.2.1f1 is live now so I'm assuming the resolution to the defect is now good to go and is available in both 2022.2.1, 2022.2.2 and any further 2022.2.Xs.

    Sorry for the confusion if you read the message and thought I was suggesting you upgrade to an alpha version -- that was not the intent of the message so do not do install an alpha for your development. That would not make sense for prod. Assuming the bug report resolution is closed, please just update to 2022.2.X or use one of the mentioned workarounds.
     
    trombonaut likes this.
  46. NikMikk

    NikMikk

    Joined:
    Nov 4, 2015
    Posts:
    25