Search Unity

Question Applying plane detection to multiple scenes in UnityAR

Discussion in 'AR' started by bytjie5678, Apr 24, 2023.

  1. bytjie5678

    bytjie5678

    Joined:
    Oct 21, 2022
    Posts:
    3
    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.
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    bytjie5678 likes this.
  3. bytjie5678

    bytjie5678

    Joined:
    Oct 21, 2022
    Posts:
    3
    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?
     
  4. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    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.
     
    bytjie5678 likes this.
  5. bytjie5678

    bytjie5678

    Joined:
    Oct 21, 2022
    Posts:
    3
    I like this idea, I will absolutely keep this in mind and do my best to implement it. Thank you.