Search Unity

Question Unity rendering AR with black screen

Discussion in 'AR' started by joaovictorpac, May 10, 2023.

  1. joaovictorpac

    joaovictorpac

    Joined:
    Jun 10, 2018
    Posts:
    19
    I'm having trouble getting my AR project to work. I'm working with coordinates to position an object in AR, but the problem is that the camera doesn't work and the screen goes black. I've tried it on 3 different devices and the screen always goes black when I try to run the app. As the devices are compatible with AR technology, I believe that the problem is with Unity itself. I don't know how to solve it.
     
    makaka-org likes this.
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    Do you use URP? If so, did you add the render feature?
    If android, did you request camera permissions?

    Any errors pop up with a debug build?
     
  3. CiaranWills

    CiaranWills

    Unity Technologies

    Joined:
    Apr 24, 2020
    Posts:
    199
    Have a look in Project Settings > XR Plug-in Management -> Project Validation and see if there are any errors or warnings in there. It will flag the most common reasons for this.
     
    makaka-org likes this.
  4. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,023
    What is your Unity version, target platform, other software versions?

    Black screen on iOS
    You need to fill Camera Usage Description in Unity Editor.
    Go to Unity Editor > Player Settings > iOS > Other Settings > Camera Usage Description > Fill it (any notice for your app).

    ---

    If you are not using a 3rd party asset to request permission like Native Camera, then the first launch of the scene will ask the permission and show the black screen anyway, the 2nd launch of the scene will show the camera stream.

    So, I use Native Camera to request permissions for all my AR Assets to avoid such user experience with black screen.