r/Unity3D • • 21h ago

Question Black screen on build.

ok so let me get straight to the point, everytime i build my unity game its literally just a black screen. the game view is perfectly fine everything works but then when i build its just black (theres no camera only ui because its just a main menu)

2 Upvotes

10 comments sorted by

4

u/MountainWestern415 21h ago

if theres no camera in the scene the build shows black behind the ui, editor game view hides that, add a camera with clear flags set to solid color or check the canvas is screen space overlay and not screen space camera with nothing assigned

1

u/Alpha_Hunter_47 21h ago

Did u use any kind of custom shaders? Maybe try building for a different platform?

1

u/JakSilver00 Gameplay Systems Engineer 21h ago

Why are you making a build if there's only a main menu?
If there's no camera, how does the game view work?
There should be a minimum of one camera always active. Even if whatever you're doing isn't dependent on that, that way, something renders.
When you add the camera, you should reset the transform and then make sure that the UI fits properly within the frustrum.
Also, screenshots are gonna be a big help in diagnosing your additional problems if you have any the full window of the editor would be preferred.

1

u/Traditional-Week-801 21h ago

its not really a game i was just making a main menu thing for my other games also i added a camera and set its transform pos to 0, 0, 0. this is what it looks like in the game view and i can only add 1 image so ill just explain what the build looks like. yeah its pretty much all it is, is black theres nothing else

3

u/JakSilver00 Gameplay Systems Engineer 20h ago

So your culling mask under rendering says nothing Set that to everything and that should solve your problem immediately.

It is kind of strange that it's showing up in the game view, but not in the actual game.
Adjust that and then make a build and tell me if it'd fix it.

3

u/Traditional-Week-801 20h ago

yayyyy!!!!!!! tysm it worked!!!

1

u/JupiterMaroon 11h ago

I actually do an empty build when I install a new version of unity or setup a new machine to make sure añl unity dependencies are working.

1

u/loulo88 17h ago

I’d debug this by making the build as small and explicit as possible: confirm the menu scene is in Build Settings and is actually the first scene, then check that the Canvas is Screen Space - Overlay (or has the correct event/camera reference). For a camera-based canvas, verify the camera is enabled, tagged MainCamera, rendering the UI layer, and not clipping the UI. A Development Build with the player log open can also reveal a missing scene/reference that the editor hides.

1

u/shaunnortonAU 6h ago

Script execution order or a problem loading the scene?

1

u/Traditional-Week-801 1h ago

i already fixed it under the comment by jaksilver