-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to correctly reload / restart an AR scene in AR Foundation 5.0.6 including XR Simulation in the Editor #1086
Comments
Did you try creating a button, then on click() event drag and drop your AR Session then call from AR Session-> Reset() method? |
|
Did you ever find a solution? I also can not figure out how to completely restart an AR session... #1107 |
By Adding SceneUtility.cs & SceneUtilitySetup.cs from this repo to my project, I could get rid of the error when switching scenes in the Editor: "MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it." My Scene is loaded 2nd time successfully, and shows the simulated environment, cloud points are shown upon Plane Detection, but Planes are not recognized... They can be recognized in a random moment after randomly moving in the scene after 15, 20, 60... seconds. I have no issues on Mobiles, only in the Editor. So, the issue is the same for 2nd, 3rd, so on reloading of the scene. P.S. I use the Default Simulated Environment for the testing. |
@makakaorg - We recently fixed a bug in 5.1.2 patch version which should fix the plane detection issue that you are seeing.
https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.1/changelog/CHANGELOG.html#fixed |
I struggled with this issue as well. I wonder till today, why there is no easy solution to put all AR stuff into a scene and load it during runtime (and undload/reload the scene if neccessary). <- for the simulated environment in Unity Editor
I call StartSession before I load an AR scene. |
How do I correctly restart an AR scene in AR Foundation 5.0.6 using the scene manager?
In other words I would like to reload the current active scene and also have all AR planes removed and the tracking session reset.
I know this has been asked before but after searching this repo and in unity forums I still came up with lots outdated solutions that don't seem to work consistently on either iOS or Android.
I also couldn't find this clearly explained in the AR Foundation documentation.
I'm also using XR Simulation in the Editor on Windows which stops working after the scene is reloaded.
The text was updated successfully, but these errors were encountered: