Applying plane detection to multiple scenes in UnityAR

Before explaining the problem, I will explain the need. Imagine an AR experience that plays out like a story. There’s different scenes with their own voice overs, and I’ve created buttons that click through them so that users can move through them at their own pace.

I have been using Unity’s AR core setup and AR foundation to make this happen, but I’ve been struggling with applying plane detection based on the need of the above mentioned setup. I am in a rather frustrating position of having to scour for the right resources. For one thing, tutorials either focus exclusively on applying plane detection and making that the main feature (when my need is that it just needs to function as the anchoring point for the different scenes, the plane doesn’t need to be visible and rendered as a mesh) or that the plane detection has something on it, but it’s a “place object on tap” functionality that duplicates objects instead of just becoming the anchoring point of a single object.

If anyone has any suggestions or can point me to a helpful resource, it would be greatly appreciated. I would also be happy to provide more specifics to the projects, or the links to these tutorials if deemed necessary.

Best practice for the use case you describe would be to attach an anchor to the plane, and parent your content to the anchor for stability. AR Anchor Manager component | AR Foundation | 5.0.7

1 Like

Thank you for your reply. How do I expand this to multiple scenes? The linked article suggests that it’s very resource intensive so should I try to have one anchor run in the background and attach each scene’s prefab to them separately? Or add an anchor manager to every scene?

This is all up to you based on your needs.

If your story involves the user staying in one physical place and browsing through multiple Unity scenes, I might suggest that you set up your XROrigin, ARSessoin, ARAnchorManager, and anchor in the first scene, then use DontDestroyOnLoad to preserve these GameObjects across the rest of your scenes.

Each of your Unity scenes could then use the same anchor as the parent GameObject for the AR content.

1 Like

I like this idea, I will absolutely keep this in mind and do my best to implement it. Thank you.