No Camera - Black Screen Issue

Not sure what’s going on, but about 50% of the time I put MARS in a project I can expect my project’s camera to stop working randomly, forcing me to create a project from scratch to “fix” the issue.

I’m using the URP and support says that I should “ensure that the AR Background Renderer Feature” is enabled, but this is only available in ARKit 3.0 forward, which doesn’t seem to be verified.

I have a Default Island set in FunctionalityInjectionModule and the ARKit plugin is properly installed. What should I do?

Edit: Added the AR Background Renderer and the issue is still present.

Did you create your project from the URP template? Also you will need to update your AR Foundation packages to at least version 3.0 to work with URP (this is probably why you don’t see the AR Background Renderer Feature as available, but it does work in 2019)

Find the ForwardRenderer asset (probably in Assets/Settings), click “Add Renderer Feature” and add the “AR Background Renderer Feature”

Let us know if that fixes it. We’re still working on a few rough edges with MARS and URP…

1 Like

@CiaranWills Hey! I updated the renderer + forward renderer and still have the same issue.

Actually, removed URP entirely from the project and the issue still persists.

Do you see any errors or suspicious looking logs from the device? Are you testing on iOS or Android?

Do you have the ARKit provider checked in Project Settings → XR Plug-in Management? I often forget this step when setting up a new project…

1 Like

Have the same issues with URP building an app where the camera wont activate. Ive created multiple projects trying to get it to work with URP in 2019.3 and 2019.4. No luck.

Literally, the first project I create using standard render and it works correctly.

1 Like

Sorry to hear you are having issues. Black screens are pretty hard to debug but with a bit more info hopefully we can figure it out. If you can tell us:

What platform are you building for (Android/ARCore, iOS/ARKit, other…)?
What versions of the AR Foundation, ARCore/ARKit and URP packages do you have?
Did you start the project from the URP template in the Unity Hub?
And as mentioned above do you have the AR Background Render Feature added to the Forward Renderer?

Another useful thing to try is just putting some geometry in front of the camera so you can tell if it’s not rendering anything at all or just missing the background.

To complement Ciaran’s answer;

@martinreimer , (if you havent already) check the FAQ Frequently Asked Questions (FAQ) | Unity MARS | 1.2.0 where it says “I built my Scene to a device and all I see is a black screen. What went wrong?”

That can get you started to diagnoze what’s happening. Specially where it mentions the URP case (ensure that the AR Background Renderer Feature is added to your SRP configuration (generally onto the ForwardRenderer asset for URP projects)).

Not using MARS, but with the latest AR packages, I get the error:

You can only call cameraDepthTarget inside the scope of a ScriptableRenderPass. Otherwise the pipeline camera target texture might have not been created or might have already been disposed.

Unity 2020.2.1f1, URP, when I build for iOS and try to use the ARBackgroundRendererFeature, The camera background stopped working, not possible to use AR.

Hi there! I assume by “not using MARS” you mean that you are seeing this issue with AR Foundation on its own? Could you please submit a bug using the Bug reporter, and ask on our AR forum?

We will certainly help track this issue, but we need to get it in front of the right people :slight_smile:

Adding the New AR Background Renderer to the Forward Renderer solved my problem for good
I’m using version 2020.1.6f1 with AR Foundation version 3.1.6

In my opinion, this has to be added to the official documentation as I couldn’t find it anywhere in the various tutorials and documentation or learn paths on Unity. Would have saved me a lot of time.

1 Like

Thanks for the note. We will try to improve our documentation in the future.

1 Like