- Home /
day/cycle blending and fading
Im following the burgzergarcade hack and slash tutorials, namely the day and night cycle Parts and I've come to a wall. When we Get to dialing down the intensity of the light, the sky box blend and the dooming effect don't match up. I will post my code later, I'm on my phone right now. Is anyone familiar with these tutorials? Here is the actual video:
Answer by getyour411 · Feb 06, 2014 at 06:07 AM
I learned alot from Petey and adopted some of that for the Day/Night cycle of a game I'm working on. I did things a little different but if you don't mind an alternative setup, I posted full code here:
http://www.getyour411.com/unoob/daynight.html
There's some parts that refer to moving this and that to pos 6000 or the 'middle' of the terrain, just move orbitControl to the middle of yours and position sun/moon according to your terrain scale.
Hey man, you always seem to be helping me out! I really appreciate it. The only thing I couldn't figure out was what you were trying to do with the switch block. You have a lot of cases in there, was that just for taking into account the possibility of many more events in the day? The only problem is that it never closes. I'm just going to add a break at the end.
That's correct, it's not used much yet but I intend to eventually use those time slices (case events) for game stuff. However, the bit about 'it never closes' makes me think I must have posted something incorrectly, I'll check it out later tonight.
I changed it around a bit to use CoRoutines for Dusk and Dawn and commented out the big switch/case since I'm not really using it at the moment, I'll add more to it later. I also added DayOfWeek though again, not using that yet either.
Your answer
![](https://koobas.hobune.stream/wayback/20220613132651im_/https://answers.unity.com/themes/thub/images/avi.jpg)