Search Unity

Best way to switch AR on and off multiple times

Discussion in 'AR' started by StefanoCecere, May 13, 2020.

  1. StefanoCecere

    StefanoCecere

    Joined:
    Jun 10, 2011
    Posts:
    211
    hi
    what is the best practice to switch from 3D camera to AR back and forth?
    should i start in 3D mode with just the ARsession and ARCamera and switch them on?
    should i instantiate them? and about the go back to 3D?
    i'm concerned also about the re-initialization order, about hanging events and garbage.

    thank you!
     
    User340 likes this.
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Wondering the same. Currently my app is crashing after going back and forth a few times.
     
  3. romtecmax

    romtecmax

    Joined:
    Oct 5, 2022
    Posts:
    4
    Does anyone have a viable solution on how to do this currently?

    I'm using AR Foundation 5.1 and I just disable / enable the AR Session and XR Origin objects. But it seems that is impacting performance of the app while showing non AR content.