The Day My Game Was Just Blue
"it's just blue?"
That was the whole bug report. A screenshot and three words. Someone had changed the map and the game was now a flat blue rectangle.
I stared at it for a good minute. The speedometer was fine. The lap timer was counting up like normal. The little minimap in the top corner was drawing the whole track, gates and everything. But the road, the car, the mountains, the sky — none of it was there. Blue.
My gut said the world failed to load. Makes sense, right? You switch maps, the new one doesn't build, you get nothing. Except that doesn't hold up, because the minimap draws its shape from the exact same track data the road uses. If the track didn't exist there'd be no minimap either. And there it was, drawn perfectly.
So the track was there. It just wasn't showing up.
the tell
Once I noticed that split it got a lot less mysterious. The HUD and the minimap are 2D, painted on a canvas layer on top of everything. The world is 3D, drawn by a camera. 2D working while 3D is dead means one thing: something switched the 3D rendering off and never switched it back.
I know exactly what does that, because I wrote it. Godot has get_viewport().disable_3d, and I flip it on whenever you open the garage or the shop. No point burning phone battery rendering a paused world behind an opaque menu you can't see through. Close the menu, flip it back off. Simple.
The flag was working perfectly. That was the problem.
the flag doesn't die when the scene does
Changing maps in my game isn't clever. I don't swap out geometry piece by piece, I just reload the entire scene from scratch and let it rebuild. Clean, reliable, easy to reason about. I like it.
But disable_3d doesn't live on the scene. It lives on the viewport, and the viewport is the window itself, which sticks around across a reload. So the flag survives when the world doesn't.
Now line up the dominoes:
1. Open the shop. 3D goes off. 2. Something closes the shop without running its normal close code. 3. Change map. Scene reloads and inherits "3D off." 4. New world builds flawlessly, renders absolutely nothing. Blue.
For the record, step 2 in my case was a spin animation on the prize wheel eating the Escape key, so the shop's tidy-up never ran. But I don't even care about the specific trigger, because there are ten of them. Any menu, any interruption, any path that reloads while the flag is set gives you the same blue screen. I'd basically buried a landmine under the map-select button.
one line, at the door
The tempting fix is to go audit every menu and make triple sure it always resets the flag. I've done that dance before. You'll miss one. There's always a phone call, an error, some new panel six months from now that forgets.
Better to stop trusting the menus. A live gameplay world needs 3D on, no exceptions, so I made the world say so itself. First thing it does when it loads:
func _ready() -> void:
# This flag rides on the viewport and survives a scene reload, so a menu can
# leave it stuck. A world that's actually being played always needs 3D on.
get_viewport().disable_3d = false
...Doesn't matter who set it or which menu was sloppy. Every world load turns it back on. Defuse it where it lands, not at every place it could get armed.
Shipped it, maps render again, done. The annoying part is that this was live for a bit and I never caught it, because a fresh boot looked completely fine the whole time. The bug only showed up on a reload. So now I've got a note stuck to my monitor: test a map change, not just a launch.
Written by Oliver
Indie game developer building 3D web experiences in Godot and Next.js. I write about creative coding, procedural generation, and game feel.