Copy the “Content” folder into your project folder (it should merge with the content folder already there);
When it asks if you want to merge folders, say yes;
Launch UnrealEd, and load the project you copied that folder to;
Go to ‘File > Open Level’ and choose “TimeOfDayTemplate.umap” (it should be located under \YourProject\Content\Maps);
Hit simulate, and watch the sun move!
Experiment with the properties in the blueprint. I’ve written comments for all of them (I think), so it shouldn’t be too hard to figure it out. Quick tip: If you want to change the speed of time, “Time Speed” is what you’re looking for.
Ha, so simple, no wonder I didn’t think of it. This is really cool now that I have it working. Now I’m trying to think about how I can cause events to trigger based on it being “night time”.
I would go about it by, in the blueprint, check your sun’s rotation and see if it is in the “night” range (aka below the horizon). Then cause events to happen if it is. If you check the skydome’s blueprint (select it and click “Edit BP_Sky_Sphere” in the details panel) they have the setup for this, which they used to blend in the stars.
EDIT: I’ll update the tutorial to include something like this when I have the time
Hi i have this working but I am looking for a way to get night to look correctly is this in engine or in the editor itself? I am also getting light from under terrain that i believe i can fix via BP but i need a better night sky but i can not find the sky settings for night anywhere.
You can make changes to the sky in the skydome blueprint (just select it and, in the details panel, click “Edit BP_Sky_Sphere”). The underground lighting could probably be fixed by turning off the sun when it goes below the horizon, I’m working to update the tutorial in relation to demonstrate how to set up something like this
Holy **** did not think that was a BP … now i said it it starts with bp… But yes i turn on and off the Sun brightness at 0.1 adn that works i just need to change the night settings now thanks.
Okay, to see where the sun is, just check your light’s “Pitch” rotation value. If that’s positive, it means it’s nighttime. Here’s the blueprint setup I used:
(Just look at the bottom section, starting with “Get Actor Rotation.”) You can then make decisions based on the “Night” boolean. The “Night Threshold” float determines how many degrees the sun must be below the horizon for it to count as night.
Alright, I’ve added the new section to the tutorial. This should fix the “sun coming through the ground” problem, and also give you a way to customize the environment to day or night.
you could use sun height to tell day and night at night the height is <0 To get the sky to actually change to night i had to modify the lerp to make my own night lery color and transition to that but now if i use a sky light my terrain gets bright at night. I’m going to see if yours does the same… are u using a terrain?
I don’t think height<0 will work, the sun in UE4 goes by rotation, not height. No, I’m not using a terrain in the tutorial, but I have used it before and it should work.
I see now I dont know what changed but the sun height does not even get to the top of or or -1 now. but i have it working. I’m adding the ability to control day cycle based on a total Seconds for cycle also I’m making a get Time function that works for 24 or 12 hour days., I’ve also integrated your change into the BP it self. Would you want me to share once I’m done? I’m brain storming adding Day night cycle and stor cycle to be able to blend to a weather environment state machine at random of on call.