Search Unity

ARFoundation iOS - Camera not always activating when ARSession begins

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

Thread Status:
Not open for further replies.
  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?
     
  3. TsvetelinaStoyanova

    TsvetelinaStoyanova

    Joined:
    Oct 16, 2020
    Posts:
    8
    Hi, I seem to have the same problem a couple of years later. Do you remember how you resolved it? I don't really like the solution with the delay, but it works.
     
  4. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    This thread is 5 years old and is not relevant to any currently supported versions of AR Foundation. Please open a new issue.
     
Thread Status:
Not open for further replies.