Open uffeflarup opened 4 years ago
Made some progress on the issue. Turns out it's related to Cloud Anchors:
If a call to XPSession.CreateCloudAnchor or XPSession.ResolveCloudAnchor is running, then it crashes when that call finishes.
I have tried to mark the hosted anchor with DontDestroyOnLoad as well, but that didn't solve the problem. And it's difficult to debug since cloud anchors don't work in Unity Editor.
After a bit more digging I can see that cancelling CreateCloudAnchor call requires a bit of modification in the Unity API (only ResolveCloudAnchor can be cancelled in the 1.18 API). But after making these changes it seems to work.
Would be nice if there was a way in the API to simply cancel all cloud anchor requests. But it works for now.
Hello all,
I'm currently working on a new feature for our AR game, where it preserves the ARCore session between scene changes. So when the player switches to a new world, then the player wont have to rescan their floor/table in order continue playing in that world. The game will continue the game on the surface that already have been scanned, which is a smoother playing experience.
The overall approach is like this, when I load a new world:
1) Call LifecycleManager.Instance.DisableSession() 2) Mark main camera (which also holds ARCoreSession and Tracked Pose Driver components) as DontDestroyOnLoad 3) Load next scene 4) Call LifecycleManager.Instance.EnableSession()
It works perfectly in Unity Editor when using Instant Preview. However, when building for Android it frequently crashes (maybe 1/3 of the times) when reaching step 4. The crash is coming through here:
I'm unable to figure out why it frequently crashes. Any ideas why disabling/enabling the ARCore session shouldn't work across scene changes?
Thank you VERY much in advance for all help.
Kind regards, Uffe Flarup