Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Consistent world upon switching between front and back cameras

Discussion in '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

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