How can I change the default background color

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By La_Blazer
:warning: Old Version Published before Godot 3 was released.

Hello, I was wondering if there is a setting that can change the project’s default background color so its not always grey. I was searching it, but the only thing I found was editor background color setting.

:bust_in_silhouette: Reply From: Bojidar Marinov

Are you talking about “Project settings” → “Render” (Section) → default_clear_color? It seems to do what you want, by setting the background color.

If you want to set it to an image, you should look into the WorldEnvironment node for 3D, and ParalaxLayer + Sprite + Texture::FLAG_REPEAT for 2D.

Thanks for your answer, yeah, It was the default_clear_color… I think I’m getting blind :slight_smile: Also thanks for the other info, someone else might find it useful in the future :slight_smile:

La_Blazer | 2016-02-26 22:09

Update: The path to the setting these days is Project Settings | Rendering | Environment | Default Clear Color

Syndog | 2021-11-17 00:20

:bust_in_silhouette: Reply From: batmanasb

From code you can use: VisualServer.set_default_clear_color(Color(0.4,0.4,0.4,1.0))

There are _ missing “VisualServer.set_default_clear_color”.

alexholly | 2016-06-20 15:18

this is an old answer, from back when the Q&A was new. So most of us didn’t understand the formatting back then and just assumed that random words in italics had underscores (_) around them. But I fixed it just now for future’s sake. :slight_smile:

batmanasb | 2016-06-21 03:22

Is there any way to get the default clear color?

rgrams | 2016-06-24 15:28

not sure, but you can see it in Project Settings > Render

batmanasb | 2016-06-24 21:58

Worked for me, thanks

leg0 | 2017-02-19 20:24

:bust_in_silhouette: Reply From: gemmomoh

In Godot 4 you can use:

RenderingServer.set_default_clear_color(Color.DODGER_BLUE)

Also through the editor:

Project Settings > General > Rendering > Environment > Default Clear Color

d2clon | 2023-04-12 18:34