Search Issue Tracker
Duplicate
Duplicate in 5.0.X
Votes
0
Found in [Package]
5.0.0-pre.10
Issue ID
ARFB-34
Regression
No
Camera Null Ref after going from Menu to Check Support and back
What Happened
I ran the Menu in AR Simulation. From there I chose the Check Support scene, then clicked Return to go back to the menu. This gave two Null Ref errors due to the camera being destroyed.
To See the Bug
Open the ARF Samples project in the Editor.
Open the Assets/Scenes/ARFoundationMenu/Menu scene.
In Build settings, select desktop platforms.
Enable XR Simulation in Project settings.
In Scene view, use the AR Simulation overlay to select the biggest office simulation environment.
Enter Play mode.
Click in Game view, scroll down until you see the Check Support button.
In Game view, click the Check Support button.
In Game view, click the Return button.
Note the errors below in Console; this is the bug.
Configuration
2021.3.0f1.2 (2021.3/staging 6eacc8284459)
MacOS 12.0.1, MacBook Pro (15-inch, 2019), 2.4 GHz 8-Core Intel Core i9
AR Foundation 5.0.0-pre.10 (f6569c5)
Errors
MissingReferenceException: The object of type 'Camera' 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.XR.Simulation.SimulationSessionSubsystem+SimulationProvider.Stop () (at Library/PackageCache/com.unity.xr.arfoundation@5.0.0-pre.10/Runtime/Simulation/Subsystems/SimulationSessionSubsystem.cs:71)
UnityEngine.SubsystemsImplementation.SubsystemWithProvider`3[TSubsystem,TSubsystemDescriptor,TProvider].OnStop () (at /Users/bokken/buildslave/unity/build/Modules/Subsystems/SubsystemWithProvider.cs:56)
UnityEngine.SubsystemsImplementation.SubsystemWithProvider.Stop () (at /Users/bokken/buildslave/unity/build/Modules/Subsystems/SubsystemWithProvider.cs:22)
UnityEngine.XR.ARFoundation.SubsystemLifecycleManager`3[TSubsystem,TSubsystemDescriptor,TProvider].OnDisable () (at Library/PackageCache/com.unity.xr.arfoundation@5.0.0-pre.10/Runtime/ARFoundation/SubsystemLifecycleManager.cs:90)
UnityEngine.XR.ARFoundation.ARSession.OnDisable () (at Library/PackageCache/com.unity.xr.arfoundation@5.0.0-pre.10/Runtime/ARFoundation/ARSession.cs:454)
MissingReferenceException: The object of type 'Camera' 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.XR.Simulation.SimulationSessionSubsystem+SimulationProvider.Stop () (at Library/PackageCache/com.unity.xr.arfoundation@5.0.0-pre.10/Runtime/Simulation/Subsystems/SimulationSessionSubsystem.cs:71)
UnityEngine.SubsystemsImplementation.SubsystemWithProvider`3[TSubsystem,TSubsystemDescriptor,TProvider].OnStop () (at /Users/bokken/buildslave/unity/build/Modules/Subsystems/SubsystemWithProvider.cs:56)
UnityEngine.SubsystemsImplementation.SubsystemWithProvider.Stop () (at /Users/bokken/buildslave/unity/build/Modules/Subsystems/SubsystemWithProvider.cs:22)
UnityEngine.SubsystemsImplementation.SubsystemWithProvider.Destroy () (at /Users/bokken/buildslave/unity/build/Modules/Subsystems/SubsystemWithProvider.cs:31)
UnityEngine.XR.Management.XRLoaderHelper.DestroySubsystem[T] () (at Library/PackageCache/com.unity.xr.management@4.2.0/Runtime/XRLoaderHelper.cs:85)
UnityEngine.XR.Simulation.SimulationLoader.Deinitialize () (at Library/PackageCache/com.unity.xr.arfoundation@5.0.0-pre.10/Runtime/Simulation/SimulationLoader.cs:56)
UnityEngine.XR.ARFoundation.LoaderUtility.Deinitialize () (at Library/PackageCache/com.unity.xr.arfoundation@5.0.0-pre.10/Runtime/ARFoundation/LoaderUtility.cs:50)
UnityEngine.XR.ARFoundation.Samples.SceneUtility.OnSceneUnloaded (UnityEngine.SceneManagement.Scene current) (at Assets/Scripts/SceneUtility.cs:20)
UnityEngine.SceneManagement.SceneManager.Internal_SceneUnloaded (UnityEngine.SceneManagement.Scene scene) (at /Users/bokken/buildslave/unity/build/Runtime/Export/SceneManager/SceneManager.cs:253)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
null
Duplicate of another internal issue: ARFB-5: Scene switching in AR Simulation casues error in SimulationSessionSubsystem
Resolution Note (5.0.X):
null
Duplicate of another internal issue: ARFB-5: Scene switching in AR Simulation casues error in SimulationSessionSubsystem