Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Consistent world upon switching between front and back cameras

Discussion in 'Handheld AR' started by nstrolight-sem, Feb 4, 2019.

  1. nstrolight-sem


    Jan 17, 2019
    I am investigating ARKit with face tracking, and have set up a program where you can swap between purely AR and a face tracking mode by enabling and disabling the ARFaceManager component. This also swaps between the front and back screens as expected. However, the AR session gets confused because of the switch, and places objects in odd positions. To sum up, I am looking to keep AR objects in the same physical position and rotation to the player. My intuition is to safely "rotate" everything around the camera while communicating to ARFoundation that the world has rotated and is not continuous from the last frame.

    A thought was to have two different AR sessions, one active at a time, keeping track of two different world states. But only one AR session can be present at a time, so this would not work.

    Is there a way to do this? Is the discontinuity expected behaviour? Thanks!
  2. tdmowrer


    Unity Technologies

    Apr 21, 2017
    Face tracking on ARKit is implemented as a different type of session, so turning it on and off effectively creates and destroys the session. I don't believe it is currently possible to do what you want.