Search Unity

AR Foundation: switch on /off AR programmatically

Discussion in 'AR' started by GHSmediaSrl, Feb 27, 2020.

  1. GHSmediaSrl

    GHSmediaSrl

    Joined:
    Dec 2, 2015
    Posts:
    12
    I have a scene that doesn't need AR features until user want to scan an ImageTag.
    Then I want the App does not prompt Camera permission until the user decides to use AR scan feature but it seems the Camera permission is prompted even if ARSession is disabled in the scene.

    Is there a way to do that?
    Which are the AR Foundation components that should be disabled in order to avoid Camera Permission prompt?

    I tried to disable both ARSession and ARSessionOrigin but Camera Permission is still prompted when scene starts.
     
    shoib_akthar likes this.
  2. GHSmediaSrl

    GHSmediaSrl

    Joined:
    Dec 2, 2015
    Posts:
    12
    Found solution in minutes ... grouping all AR Foundation gameobjects (AR Session and AR Session Origin) in a prefab then instantiate it the first time user wants use AR features