Day Night Time Cycle in Godot 3D Help

Godot Version

Godot 4.6

Question

I want to make a day night time system for my game similar to Pikmin. Where it changes colors based on the time and at a certain point, the player will have to stop the day. I’m unsure on how to properly do this though. I want this to be for 3D so the skybox changes as well. How do I do this?

You may be able to animate a DirectionalLight3D’s rotation and color/intensity over an AnimationPlayer. The world environment’s sky could also be animated the same way, a procedural sky may be easiest to animate.

1 Like

Take a look at sky shaders. There are some on Godot Shaders. Then change the main directional light color and move it across the sky.

1 Like

I’ve been doing what you said with animation and it’s been working out well so far. However, I’ve ran into a problem with the sky animation specifically. I want to use a sky image for the animation but I’m having a problem with how the animation will transition between different states. When it goes from dawn to day it will hard cut to a lighter image of the sky. I want some sort of transition there. Any advice with this?

You would have to write a shader for that sort of effect, cross fading an image would require more work than the AnimationPlayer knows about.

1 Like

Alrighty, I’ll try and find a shader then. Thank you.

I like this sky by @binbun3d:

2 Likes