Search code examples
unity-game-enginemapboxaugmented-reality

Unity : project works in editor but black screen when build


I'm on a project using Unity 2019 LTS and some unity SDK / package:

  • Mapbox SDK
  • DreamWorld SDK (the SDK of my AR headset)
  • some other default AR packages (Foundation, Subsystem)

I would like to reused the Mapbox World-scale AR example in order to implement the possibility to move the scene according my AR headset position.

To do so, I removed the default main camera of the example (in AR Root) and added instead a the camera for my headset, as explained in the headset's docs (DW Developer Kit SDK).

Here are some pictures of what I've done:

enter image description here

enter image description here

enter image description here

enter image description here

No here's my problem: when I run the project in the editor with the player mode, all works perfectly fine and I see the camera rotation following the position of my AR headset.

Therefore, if I try to build the project, I cannot the see the "view" of the camera. I know that the project run because I still can see the overlay menu provides by the Mapbox World-scale example but not my camera.

Editor :

enter image description here

Build :

enter image description here

I searched online to find some solution to my issue but I only found some answer about building to Android and iPhone while I trying to build on my laptop.

The fact I see a black screen (and the overlay) seems to me that Unity cannot find a camera to show me the scene.

I just started using Unity, so it is possible that I missed an obvious thing but I don't know what.

If someone as any idea of what my problem is...


Solution

  • General Solution

    Just Remove and Re-Add your Main Scene under the menu File / Build Settings / Scene In Build.

    Use Add Open Scenes Button to re-add the scene.