Search Unity

Consistent world upon switching between front and back cameras

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

  1. nstrolight-sem

    nstrolight-sem

    Joined:
    Jan 17, 2019
    Posts:
    3
    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

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    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.