Search Unity

AF Foundation Camera switching not working

Discussion in 'AR' started by Suwas93, Sep 19, 2020.

  1. Suwas93

    Suwas93

    Joined:
    Feb 8, 2018
    Posts:
    62
    AR Foundation iOS Objects get stuck to the camera after switching from User to World. It seems like the camera pose isn't updating properly after switching back to the world view. Would really appreciate some help. Thanks
     
  2. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,143
    I encountered a similar bug on the new iPad with LiDAR.
    It seems to me, the issue is related to devices that can track 6 degrees of freedom on the front camera. And after you switch to a back camera, the camera position and rotation will not be updated. Here is a memo I left for my future self in the comments :)

    "Bug in ARKit: camera position and rotation will not receive updates with world camera and session state will always be <= SessionInitializing if all these conditions are met:
    - your AR device supports face tracking with 6 degrees of freedom
    - ARFaceManager is enabled
    - requestedTrackingMode is set to TrackingMode.PositionAndRotation
    - AR Foundation >= 4.0"

    The solution is to set tracking mode to TrackingMode.RotationOnly when using face tracking.
     
    Last edited: May 9, 2023
  3. Suwas93

    Suwas93

    Joined:
    Feb 8, 2018
    Posts:
    62
    Did you find any work around for this?
     
  4. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,143
    Oops, I forgot to mention the solution, sorry.
    The solution is to set the tracking mode to TrackingMode.RotationOnly when using face tracking.
     
    Last edited: May 9, 2023
    zivmahluf likes this.
  5. Suwas93

    Suwas93

    Joined:
    Feb 8, 2018
    Posts:
    62
    Thanks a lot!