I’m not sure what is happening suddenly I lost possibility of using instant preview. When I click “play” i see white screen instead of preview from camera and when I pause it in the console I see
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.XR.ARBackgroundRenderer.DisableARBackgroundRendering () (at C:/buildslave/unity/build/Runtime/AR/ScriptBindings/ARBackgroundRenderer.cs:172)
UnityEngine.XR.ARBackgroundRenderer.set_mode (ARRenderMode value) (at C:/buildslave/unity/build/Runtime/AR/ScriptBindings/ARBackgroundRenderer.cs:109)
GoogleARCore.ARCoreBackgroundRenderer.Disable () (at Assets/GoogleARCore/SDK/Scripts/ARCoreBackgroundRenderer.cs:103)
GoogleARCore.ARCoreBackgroundRenderer.OnDisable () (at Assets/GoogleARCore/SDK/Scripts/ARCoreBackgroundRenderer.cs:66)
I got the same problem when i switch to another project using ARCore and instant preview. Everything works fine until i switch a project. Instant preview turns white and don’t connect with editor anymore.
I believe that only one instance of Unity running instant preview at a time is allowed. So if you had one instance up and running close it before trying another…
I got the same problem when running HelloAR with instant preview on my Samsung Galaxy S8 (SM G950F, Android 8.0.0). Run on MacBook with Unity 2018.1.0f2 and ARCore 1.2.
Screen shot when I run directly by touching the App’s icon, not by instant preview.
I just found the reason of my case. Unity ARKit plugin affected some settings (I don’t know what setting) and made issues for AR Core. If you run AR Core and ARKit in separate project, you will avoid that problem.