Working Basic Day/Night Cycle w/ Updating sun

Hey folks, after a bit playing in the BP system I was able to create a basic day/night cycle. It even updates the sun’s position in the BP_Sky_Sphere, so you’ll still get the nice color changes around the horizon.

You just have to attach your Directional Light Source (set to moveable) and your BP_Sky_Sphere to the variables and away you go! I set mine up so i can just drop it into a map, vs loading it in the level BP.

**UPDATE: **

Big thanks to ExeRange for creating a small tutorial video showing how to set this guy up in game. Here is his video:



Thx for share

Thx for share

Ditto. Nice job.

Thanks! I’m thinking about updating it to be more feature rich (set day/night cycle time, etc), and going to also try and see if I can get it to dynamically update the skylight AO.

Probably a noob question, but I want to make this a class blueprint, so I assigned a directional light as a component (set to ‘movable’ and ‘used as atmosphere’). But I can’t seem to be able to link my directional light variable to Set Actor Rotation: "object’DirectionalLightComponent’ is not compatible with object’Actor’ ". What should I do?

Mod: And the ‘Set Refresh Material’-node needs a boolean instead of my SkySphere reference? Guess I’m doing it all wrong. :wink:

You just have to use DirectionalLight and not DirectionalLightComponent. :slight_smile:

thanks for the blueprint

How I can change this?

When you create your variable for the sun just make sure you choose Directional Light and not Directional Light Component. Also make sure you click the little eye next to the var, so you have access to it via properties in the editor. I know of some one else who is working on a Day/Night system with a tutorial video, but if it doesn’t come out soon, I’ll do one as a primer for theirs.

thx you works fine :slight_smile:

I got this working but I’m having serious trouble making it look good… there’s no ambient lighting so everything is black on one side depending on what side the sun is on and the lighting looks really too bright or not bright enough at times.

I guess until we have GI we need some other ambient lighting in the scene and ramp it up and down based on the day night cycle as well? I have a large terrain… is there an easy way to add ambient lighting that just affects everything rather than adding loads of point lights everywhere?

use the SkyLight lighting

I’m having trouble setting this up. I created a blueprint. I added the BP_Skysphere asset that creates the skysphere and added a directional light. The light I now attach to my blueprint for the time of day using the right-click -> Attach To context menu within the Scene Outliner. However, the skysphere doesn’t want to add onto it, since the skysphere is a static actor and the new blueprint is not one. Could you help me out here?

It looks like my method of ‘attaching’ is wrong to begin with. I don’t see the lightpoint in the Blueprint. Also, I can’t add these assets as components of the blueprint, for it won’t let me drag them into there.

This looks very nice, but I’m having trouble attaching the Actor (the Directional Light Source and the BP_Sky_Sphere) to the variables. I can’t seem to find anything to explain how to do this. I use the TP_ThirdPersonBP template. Can anyone help me with this problem?

I did everything as stated… but it still didnt work could you please post a screenshot of your ‘Sun’ and ‘Skysphere’ detail window, it would be much appreciated.

EDIT: I managed to make it work, thanks for this tutorial :wink:

Yea I can post those a little later today.

For all of you who don’t get it to work properly or is having trouble, I’ve decided to record the way I set it up.

Correct me if I’m wrong, but is this the way you meant it nbazzeghin? :slight_smile:

If you’ve watched the video, would you please send me a private message with you opinion on it? It is my first ‘tutorial’-ish video I’ve made. I would like to make more video’s, but I need some feedback on my English (I am originally Dutch) and the way I present it. :smiley:

Perfect! That is exactly the type of short little tutorial I was going to do. Im working on a much more advanced version right now, and I’ve heard another user on the forums has a tutorial video of their version of it. I haven’t been able to find it at the moment (guy at work let me know about it :wink: ) Do you mind if I link this at the start of the thread?

No, I don’t mind! Glad you liked it :smiley:

is it me or did they remove, update sun direction in 4.2?