Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

ARFoundation iOS - Camera not always activating when ARSession begins

Discussion in 'AR' started by Numa, Sep 23, 2019.

  1. Numa

    Numa

    Joined:
    Oct 7, 2014
    Posts:
    100
    Hi,

    I've noticed that sometimes when the ARSession begins the camera doesn't "activate" and the app just shows whatever background the unity camera is set to use, instead of the real world.

    Is there an order in which components need to be turned on when starting an AR session? When this happens it seems like turning the ARSession component on and off solves the problem.

    This happens randomly either when having everything setup on app startup, or when starting the session in code by turning on all the relevant components.

    I thought I'd fixed it by adding a slight delay between starting the session and enabling the camera + background managers, but turns out it keeps happening from time to time.

    Since there are a few components required to run an AR session, could it be a race condition between:
    ARSession
    ARInputManager
    ARSessionOrigin
    CameraManager
    TrackedPoseDriver
    ARCameraBackground

    Any help appreciated, this never happened with the old ARKit plugin, seems to be an ARFoundation thing.

    edit: Using Unity 2019.2.0f1 and ARFoundation 3.0.0 preview 2
     
    Last edited: Sep 28, 2019
    simon_unity488 likes this.
  2. ArtyD2

    ArtyD2

    Joined:
    Nov 6, 2020
    Posts:
    2
    Hi, this sounds exactly like something that I've been running. Did you ever manage fix this?