How Do I Change The Time of Day?

I was wondering how I would be able to set a different time of day in the environment to suit the setting of a demo I’m in the middle of creating. Is this done in blueprints? If so, how is it done? I haven’t done anything in blueprints yet but apparently that’s how you do a lot of things in UE4 and I’ve been thinking of getting into them since I’ve got a pretty good grasp on level creation now. In my current project there is an asset called “BP_Sky_Sphere” which I am guessing refers to the blueprint code of how the sky and clouds are able to rotate around in real time. Would I use this to set a time of day or a day cycle?

Also, would I be able to set up a sort of time of day cycle as well where the time of day updates continuously in real time? All of this would be awesome to learn.

You have to create a day&night cycle v=xt_TIYthRUE (basic tutorial -> more advanced ones on youtube/wiki)
When you want to set the time permanently -> just rotate the directional light :slight_smile:

1 Like

I have a problem with the Blueprint that I had made. The Blueprint that changes the sun’s rotation does seem to work, in a way, but the time of day does not actually change. The shadows do follow a rotation but what I really want from it is the actual day time to change, not just the position of the shadows to change. I’m not sure what I did wrong or if there’s something that I had missed.

://i.imgur/nZMI5X4.png

It seems right but I don’t know what I did wrong.

Are you using 4.7 p7? If so, this is a known issue that will be fixed with the next release.

Wait, this is a known issue?! I’ve been pulling out my hair and have remade my project from the ground-up just because of this :frowning: I didn’t read this in the preview release / bug thread.

Not sure it was in the notes as a known. I found it when it was reported in answerhub.

Probably not the best idea to develop projects in a preview build. Things will be broken. :wink:

Our team doesn’t even use the stable builds when they come out; we wait for 4.x.x builds.

But it helps find the problems before the next stable release :wink: I know you should create-a-copy but why not just create-a-copy and work on it and then update and repeat? :>

I’m using version 4.6.1 and I still have problems.

In that case you can take a look at my sample project made using Gregdumbs Wiki tutorial here: https://forums.unrealengine/showthread.php?56777-Photons-Be-Free-Mini-tutorials-and-other-curiosities&p=209224&viewfull=1#post209224

I used his setup and this was made in 4.6.1 so you can give that a shot for comparison if you like.

Let me know if that works for you.

Is UE4 v 4.7 now a stable release? One of the last times I checked, it was a preview build but now according to the launcher it just says v4.7 so I’m guessing it’s stable now?

If so, I’ll probably update to it. Are there any known problems with updating to a newer version if a project is stuck in, say, v4.6.1?

I received an error while remaking the Blueprint. This happened the first time as well but I clicked compile anyways. How do I fix this?

://i.imgur/CHN6D5o.png

Do you have such a variable in your blueprint? :slight_smile: -> otherwise create a float var with the same nam

The ‘Rotational Sun Speed’ is a float variable in the blueprint so I’m still not sure what’s wrong.

The blueprint now says there’s no more errors for some reason but the Sun still isn’t orbiting, only the shadows are.

The final build has not been released yet. This is still 4.7 Preview 7. If you use the build, just make a copy of your project, Do not convert in place as that is always bad practice and it’s best to always have a back up of your project.

If you’ve not set a value for the sun rotation speed then the default is zero. The “Error” you see when you create the float is just there so that when you compile you can select the variable in the panel on the left and scroll to the bottom and set a value for your float variable. Otherwise it will always be 0.

If you set it to something like 5 you’ll see the sun start moving.

Give that a shot and let us know. :slight_smile:

I’ve already tried that and the only thing that changes are the shadows.

EDIT: YES!! I changed the Directional Light Actor in the editor from light source to the blueprint sun and now the Sun follows a rotation. Thanks for all the help :slight_smile:

Awesome! Glad it’s working for you! :smiley:

Did this not get fixed for 4.7.08? :<

Hi Kitatus Stuidos,

I responded to your post on the 4.7 preview thread as well. With 4.7 p8 I’m not seeing anything wrong on my end.

The sun disc is rotating when the material for the skysphere is updated.

This is the project I use for testing any ToD issues: https://forums.unrealengine/showthread.php?56777-Photons-Be-Free-Mini-tutorials-and-other-curiosities&p=209224&viewfull=1#post209224