If anyone's wondering why their game is super dark at night with this method, it's probably because your environment lighting source was set to skybox. I chose color and then this works great! I also added a fog density variable with thicker fog at night which is a nice touch.
Awesome stuff! Just put it into my game and it's working great. I have a custom time system since my game is realtime but we wanted the days to be sped up, but thankfully I created enough pure functions for translating the timing that made this almost instant to pop in.
Really great tutorial! Thanks for putting it together for us. I just found your channel and immediately subscribed ;-). Short, single-topic tutorials make the world a better place for everyone.
Hello, i have a question, how do i make the sun slower? Edit, found it my self: By setting in line 22 "TimeOfDay %= 24f;" to 600 and in line 23 "UpdateLighting(TimeOfDay / 24f);" to 600 the day and night is longer and dont forgot it in line 10 and 27 to change to your custom number... so like at me 600 600 = 10 min, so if u want 12 mins or so search for 12 min in secconds
Slight issue with mine. I made colors as close as I could to the video, but when it gets to the later side of the night it's basically pitch black on screen. I tried adjusting the colors to grey where it was pitch black but that didn't help at all.
I took the script from the video, along with changes made by @cuckoo gaming below, and made some additional changes. This script now speeds up the late night hours, increases the directional light & softens the shadows toward noon. The rest of the class from the original script remains the same. (This was made using Unity 2019.4.19f1 LTS.) public class LightingManager : MonoBehaviour { //Scene References [SerializeField] private Light DirectionalLight; [SerializeField] private LightingPreset Preset; //Variables [SerializeField, Range(0, 24)] private float TimeOfDay; [SerializeField, Range(-10, 10)] private float speedMultiplier; // used to adjust the cycle time. Note that values < 0 will reverse it! [SerializeField, Range(1, 10)] private float nightSpeed; // how much to speed up late-night hours [SerializeField] private float maxIntensity = 1.5f; private float baseIntensity = 0f; [SerializeField] private float maxShadowStrength = 1f; [SerializeField] private float minShadowStrength = 0.2f; private float nightSpeedUpStart = 20f; private float nightSpeedUpEnd = 4f; private float dawn = 6f; private float dusk = 18f; private float noon = 12f;
private void Start() { // default values speedMultiplier = 0.1f; nightSpeed = 10.0f; baseIntensity = maxIntensity / 2f; } private void Update() { if (Preset == null) return; if (Application.isPlaying) { //(Replace with a reference to the game time) // speed up the time in dead of night if (TimeOfDay > nightSpeedUpStart || TimeOfDay < nightSpeedUpEnd) // speed up the passage of night from 9pm to 3am { // TimeOfDay += Time.deltaTime * speedMultiplier * nightSpeed; TimeOfDay += Time.deltaTime * nightSpeed; } else { TimeOfDay += Time.deltaTime * speedMultiplier; // adjust light intensity and shadow softness for time of day if (TimeOfDay >= dawn && TimeOfDay noon && TimeOfDay
Thanks for this great Tutorial. It's awesome. I made it work in my project, the directional light moves and it cast the shadows correctly, but the sun movement seems to not be properly configured so it doesn't animate. I have always the same sky. Any tips?
Hey man, thanks for putting such an awesome tutorial together. I binged watched all your dev logs off the back of this. I love the farming game genre at the moment, nice and relaxing! I'm trying to figure out how best to implement an arc in the directional light throughout the day, so it's not just a fixed up and over journey (Later on down the line i'd like to attach this to change with seasons etc..but just for right now...) Any idea where you'd begin with adding an arc to this cycle? Keep it up, best of luck with the project and hope you're safe with everything that's going on at the moment!
I have a problem. The script works on the terrain before generating lighting, after I generate though, the ambient color doesn't apply anymore. Any fix for this?
i cant add the directional light to the lighting section in the inspector and I also cant seem to find the 'time of day' the only thing on the lighting manager is the directional light which I cant add but I have on in my scene and also the preset which is added fine any help I would appreciate
Does anybody know how I can use this script to affect ambient sound? So when it will play an audio source during the day then swap to a new one at night. Great tutorial by the way I know nothing about coding and got this to work easily so thank you
hi thank you for tutorial. i have 3 question. 1- how make day and night longer? 2- how set start game from Day not Night? 3- how set moon for night? sorry for my english
Hi, 1: This depends on how much you are adding to the TimeOfDay in Update, here I just add the Time.deltaTime, which is the time in seconds that has passed (between the last Update() call), so since TimeOfDay is between 0 and 24 it would take 24 seconds for the full cycle. You could write a method that multiplies/divides Time.deltaTime by a factor that would slow down or speed up the time it takes for a cycle (e.g. Time.deltaTime/2 means it would take 48 seconds for a cyle, or 2 seconds per hour), this could also check if the time was day or night and use a different multiplier. 2. The start time is dependent on what TimeOfDay is, so you could either set it using the slider in the inspector, or set the value in the Start() or Awake() function. 3. You could either get a custom shader for the skybox that would display a moon, or put an object in the sky to represent the moon. Since the directional light already rotates with the time of day you could then move it to the center of your scene and add the moon object as a child object so when the directional light rotates it would also move the moon, then just reposition the moon to be in the correct place when it's night time. As long as the pivot point, in this case the directional light, is in the center it should rotate the moon comfortably around the sky. Hope that helps, Your english is pretty good!
please help me. I followed the instructions of the tutorial, but I keep getting the same error CS0246 "The type or namespace name 'LightingPreset' could not be found (are you missing a using directive or an assembly reference?"
Hey so when i made my preset it all worked but one main thing. When i look above the ambient color where it says script. Theres nothing in the script box and it wont let me put the lighting preset script into it. Can you please help? Also like how make the tutorial easy to follow thank you
Hello. I have a question: In the Lightning settings, what kind of environment lighting should I use? Source from skybox, gradient or color? I'm working on Unity 2018.4.9f1. Thank you very much for the tutorial. Works really well and the code is clean and easy. Congrats.
Hi, I'm using just the color source in this tutorial. You could also use the skybox material if you had some way to change the material color (with the procedural skybox this can be done by rotating the directional light). Thanks!
I just created a speed multiplier like this: [SerializeField] private float speedMultiplier; private void Update() { if (preset == null) return; if(Application.isPlaying) { timeOfDay += Time.deltaTime * speedMultiplier; timeOfDay %= 24; //clamp between 0-24 UpdateLighting(timeOfDay / 24f); } else { UpdateLighting(timeOfDay / 24f); } } Set it to 0.x to slow down the time of day
can also add just a float i.e MinutesInDay = 1f. then just change the TimeOfDay = Time.deltaTime to Time.deltaTime / (MinutesInDay * 60f) which will give you a 30 min day cycle
hey, really nice and helpful tutorial, idiot question (i'm new to unity, don't blast me LMAO): is there a way to slow down the cycle? Thanks a lot EDIT: I found out the way to do it, if someone else needs it, you just need to multiply the Time.deltaTime in the TimeOfDay assignment for a number (if you want to slow it down it must be a number below 1, if you want to speed it up you'll need a number higher than 1)
Is there a way to change the selected preset settings from the object with the script attached? kind of like how you can change a material's settings when you have selected an object in the scene that has that material asigned?
Hey! Good tutorial, thanks! How can I change lighting preset with a unity event? For example, I'm triggering rain with an event with delay, and I want to change the Lighting Preset to a more rainy sky colors. How can I do that?
in the video misses the part where "SceneManagement" object is created (or i missed it)... i'm new to unity and i don't know what kinf of object scenmanagement is and how is created
Hi!I have a question.I copied the exact same code that you put in the link but when i try to put LightingPreset script to Directional light it says "Script´s type not found".What can I do?
You can do it with precomputed realtime global illumination by just changing the ambient color, but to do the same with just baked global illumination you would probably need to write a custom shader.
Hey Glynn, awesome tutorial! I have a problem, the object in my hand changes color with the ambient color, and I can't find a way to solve this, if you could help me that would be awesome
Don't know what I'm doing wrong, but the sky doesn't change color for me.. I did everything the way you did and the lighting works, but the sky itself is one constant color
Hi great video it really helped me but I had some questions 1- can I do something like this if it turns night I can turn on some lights something like this if (timeofday == 20) {Findobjectoftype.getcomponent .setactive (true) 2-is there a way to add a moon and stars too the sky at night time really looks wired
i followed your script code (which i only understand a little) but when writing the LightingManager script i cant use "[SerializeField] private LightingPreset Preset;" because it says that it cannot be found
It might be that you do not have the lighting preset script/class, or that there's no "using UnityEngine;" import at the top of the lighting manager script?
@@618Lonewolf I did and i made the preset i can even control it and added it on the preset manager, ill try watching your video again thanks for the reply
@@618Lonewolf Hey i finally got it working, but theres a problem with the shadows because whenever the sun gets to the low point there is shadow from the objects that are pointing up
@@jepubepu9570 Good to hear! Hmm you could probably either limit the angle that the sun can go down to, or reduce the light intensity of the directional light as it rotates towards that angle?
I know this is an older video, but everything still seems to work great. I have a question if anyone is able/willing to help. Unity's UI is pretty different now so I'm not sure where these scripts should go. I put the lighting manager on the directional light and that made it work, but should it be elsewhere (maybe a game manager empty object)?
@@bryvoydatch8805so did you put the lightning manager on the directional light? I'm also using unity and it looks different now. Changing the colors or the time of day doesn't do anything in my game, it stays the same color. I added it on the directional light
I think you're thinking of integer values when you include both 0 and 24 (inclusive), since this is a float and the upper value is not included/exclusive (24 % 24 is 0) it's more of a range of 0 - 23.99999*.
I did that by adding a second light facing the opposite direction, then making it a child of the sun. you might need to toggle between them to avoid shadow glitches.
If anyone's wondering why their game is super dark at night with this method, it's probably because your environment lighting source was set to skybox. I chose color and then this works great! I also added a fog density variable with thicker fog at night which is a nice touch.
Wait how do you do this because i see under light in the inspector I see the color thingy but how do i change it to not be so dark?
@@Rubberduckerino Window -> Rendering -> Lighting -> Environment -> Source
can you explain how you did it pls?
@@thunderx2153 Comment above u tells u how to switch to lighting source to color
how can we slow the proces down like suppose i want 1 day in my game to be like 1 minute long?
Dang if only I had seen this before the end of the ludem dare compo It would have really added some polish. Great channel btw.
Glad you liked it :D Thanks!
This looks so cool! I've my own Day/Night script that changes out directional lights, skyboxes, and fog colors. This looks so much smoother!
@Avi the Tiger
Do you have github to see how it's work ?
@@ndejesus34800he just told how it’s working
Bruh this dude is like a coding GOD. I paused like 50 times trying to keep up lol
uh oh
also means he's bad at tutorials for others to follow
I love the people that give code for free, don't stop coding!
Awesome stuff! Just put it into my game and it's working great. I have a custom time system since my game is realtime but we wanted the days to be sped up, but thankfully I created enough pure functions for translating the timing that made this almost instant to pop in.
Nice work, Glynn! Simple, and certainly looks good enough to get the job done. :)
Thanks a bunch! I love the simpleness of it and how quick you can change the colours :D
Really great tutorial! Thanks for putting it together for us. I just found your channel and immediately subscribed ;-). Short, single-topic tutorials make the world a better place for everyone.
Thanks I'm glad you liked it :D I feel that too, alot of hour long tutorials out there XD
Excellent, this is exactly what I was looking for, and it is simple to use. Thank you.
Very nice tutorial, like how you structured the data and used validators, never kneew this was even possible! 😱 This is awesome!! 😁👍 🌜🌞
Thanks, I'm glad it had some useful tidbits! :D
Thanks for this great video! Really easy to follow and does it's job wonderfully
Fantastic walkthrough! Thank you :D
Straight to the point and a clear explanation, great tutorial
Thanks this works perfect for a open world project I'm developing
This is a really good tutorial, thank you bro
Thank you for your help Mr. Glynn. God bless
amazing tutorial
all I changes was a I added a public float to change the day length in editor
Hello, i have a question, how do i make the sun slower?
Edit, found it my self:
By setting in line 22 "TimeOfDay %= 24f;" to 600 and in line 23 "UpdateLighting(TimeOfDay / 24f);" to 600 the day and night is longer
and dont forgot it in line 10 and 27 to change to your custom number... so like at me 600
600 = 10 min, so if u want 12 mins or so search for 12 min in secconds
Hey, I tried it, but I prefered dividing the time added by 10, like this: timeofDay += Time.deltaTime / 10;
And leaving the Update Lighting /24 :D
@@beorgames7802 Why not just multiply the value of timeOfDay by some speed variable?
i am a beginner so do we set TimeOfDay% = 600f or just erase it all and write 600
@@dattebayo2000 Hi, i am no longer into unity stuff i forget everything about that, sorry
its alright :)@@ElectroGehirn
I cant figure out how to get those multi colored gradients at 1:52.... ;___;
This is perfect for my project, thx!
Slight issue with mine. I made colors as close as I could to the video, but when it gets to the later side of the night it's basically pitch black on screen. I tried adjusting the colors to grey where it was pitch black but that didn't help at all.
I took the script from the video, along with changes made by @cuckoo gaming below, and made some additional changes. This script now speeds up the late night hours, increases the directional light & softens the shadows toward noon. The rest of the class from the original script remains the same. (This was made using Unity 2019.4.19f1 LTS.)
public class LightingManager : MonoBehaviour
{
//Scene References
[SerializeField] private Light DirectionalLight;
[SerializeField] private LightingPreset Preset;
//Variables
[SerializeField, Range(0, 24)] private float TimeOfDay;
[SerializeField, Range(-10, 10)] private float speedMultiplier; // used to adjust the cycle time. Note that values < 0 will reverse it!
[SerializeField, Range(1, 10)] private float nightSpeed; // how much to speed up late-night hours
[SerializeField] private float maxIntensity = 1.5f;
private float baseIntensity = 0f;
[SerializeField] private float maxShadowStrength = 1f;
[SerializeField] private float minShadowStrength = 0.2f;
private float nightSpeedUpStart = 20f;
private float nightSpeedUpEnd = 4f;
private float dawn = 6f;
private float dusk = 18f;
private float noon = 12f;
private void Start()
{
// default values
speedMultiplier = 0.1f;
nightSpeed = 10.0f;
baseIntensity = maxIntensity / 2f;
}
private void Update()
{
if (Preset == null)
return;
if (Application.isPlaying)
{
//(Replace with a reference to the game time)
// speed up the time in dead of night
if (TimeOfDay > nightSpeedUpStart || TimeOfDay < nightSpeedUpEnd) // speed up the passage of night from 9pm to 3am
{
// TimeOfDay += Time.deltaTime * speedMultiplier * nightSpeed;
TimeOfDay += Time.deltaTime * nightSpeed;
}
else
{
TimeOfDay += Time.deltaTime * speedMultiplier;
// adjust light intensity and shadow softness for time of day
if (TimeOfDay >= dawn && TimeOfDay noon && TimeOfDay
saved my life, Thanks S2
hi thx but the lightingupdate does not exist can someone help pls??
DUDE thank you so so so so so much you are life saver thanks for the tutorial thank you so much
Great tutorial, thank you so much! :)
Everything works fine, except when the "sun" is at its 0 the floor turns completely black and that doesnt look that great, any idea?
Thanks for this great Tutorial. It's awesome. I made it work in my project, the directional light moves and it cast the shadows correctly, but the sun movement seems to not be properly configured so it doesn't animate. I have always the same sky. Any tips?
Just the right thing i need for Ludum Dare 45 xD
thx m8
the hardest part of this video is figuring out how you actually got that screen to pop up in the inspector.
Hey man, thanks for putting such an awesome tutorial together. I binged watched all your dev logs off the back of this. I love the farming game genre at the moment, nice and relaxing!
I'm trying to figure out how best to implement an arc in the directional light throughout the day, so it's not just a fixed up and over journey (Later on down the line i'd like to attach this to change with seasons etc..but just for right now...)
Any idea where you'd begin with adding an arc to this cycle?
Keep it up, best of luck with the project and hope you're safe with everything that's going on at the moment!
I copied your exact script but unity doesn’t give me the option to create a scriptable, is it because I have an earlier version?
I have a problem. The script works on the terrain before generating lighting, after I generate though, the ambient color doesn't apply anymore. Any fix for this?
wild tutorial I love it thanks so much
1:52 the fart
how can we slow the proces down like suppose i want 1 day in my game to be like 1 minute long?
i cant add the directional light to the lighting section in the inspector and I also cant seem to find the 'time of day' the only thing on the lighting manager is the directional light which I cant add but I have on in my scene and also the preset which is added fine any help I would appreciate
Thanks You Bro..You Help Me a lot..🥰
Thanks, bookmarked!
Does anybody know how I can use this script to affect ambient sound? So when it will play an audio source during the day then swap to a new one at night.
Great tutorial by the way I know nothing about coding and got this to work easily so thank you
when the time of day = a certain time play a new sound
How do you make the cycle slower?
hi thank you for tutorial. i have 3 question. 1- how make day and night longer? 2- how set start game from Day not Night? 3- how set moon for night? sorry for my english
Hi, 1: This depends on how much you are adding to the TimeOfDay in Update, here I just add the Time.deltaTime, which is the time in seconds that has passed (between the last Update() call), so since TimeOfDay is between 0 and 24 it would take 24 seconds for the full cycle. You could write a method that multiplies/divides Time.deltaTime by a factor that would slow down or speed up the time it takes for a cycle (e.g. Time.deltaTime/2 means it would take 48 seconds for a cyle, or 2 seconds per hour), this could also check if the time was day or night and use a different multiplier.
2. The start time is dependent on what TimeOfDay is, so you could either set it using the slider in the inspector, or set the value in the Start() or Awake() function.
3. You could either get a custom shader for the skybox that would display a moon, or put an object in the sky to represent the moon. Since the directional light already rotates with the time of day you could then move it to the center of your scene and add the moon object as a child object so when the directional light rotates it would also move the moon, then just reposition the moon to be in the correct place when it's night time. As long as the pivot point, in this case the directional light, is in the center it should rotate the moon comfortably around the sky.
Hope that helps, Your english is pretty good!
please help me.
I followed the instructions of the tutorial, but I keep getting the same error
CS0246 "The type or namespace name 'LightingPreset' could not be found (are you missing a using directive or an assembly reference?"
Bc ur script dont named LightingPreset
Hey so when i made my preset it all worked but one main thing. When i look above the ambient color where it says script. Theres nothing in the script box and it wont let me put the lighting preset script into it. Can you please help?
Also like how make the tutorial easy to follow thank you
You need to create an empty game object and assign the lightnin manager script to it. You cant directly assign objects to the script
I LOVE ITTT!! THX SO MUCHHHH!! New Subbbb
Hello. I have a question:
In the Lightning settings, what kind of environment lighting should I use? Source from skybox, gradient or color?
I'm working on Unity 2018.4.9f1.
Thank you very much for the tutorial. Works really well and the code is clean and easy. Congrats.
Hi, I'm using just the color source in this tutorial. You could also use the skybox material if you had some way to change the material color (with the procedural skybox this can be done by rotating the directional light).
Thanks!
How to slow down the speed of time of day function
I just created a speed multiplier like this:
[SerializeField] private float speedMultiplier;
private void Update()
{
if (preset == null)
return;
if(Application.isPlaying)
{
timeOfDay += Time.deltaTime * speedMultiplier;
timeOfDay %= 24; //clamp between 0-24
UpdateLighting(timeOfDay / 24f);
}
else
{
UpdateLighting(timeOfDay / 24f);
}
}
Set it to 0.x to slow down the time of day
can also add just a float i.e MinutesInDay = 1f. then just change the TimeOfDay = Time.deltaTime to Time.deltaTime / (MinutesInDay * 60f) which will give you a 30 min day cycle
Thanks Glynn! :D
Not sure why, but the changes are not parsing in the editor, only when I hit play.
I followed the script but when it becomes night everything is red, even though I didn’t set the color to red. Any tips on how to fix?
its been 5 months and dude still hasn’t got an answer
@@funnyvideoslive9721 it’s been 9 months now
@Crimson Gaming 1 year and 6 months
@@m0dd3dtut0rials5 1 year and 7 months XD
@@redcoin4853 2 years
Great video thank you so much sir
Tutorial is nice. Can you give me your lighting preset please?
nice work, you earn a sub
I've followed just about everything but how do you get to the menu that allows you to control the time of day?
If you still need help with this i just figured it out, click on create empty on your hierarchy then add the lighting manager to it
@@Hikk Thank you so much for that because I was racking my brain on that!!
@@Hikk Thank you so much!
hey, really nice and helpful tutorial, idiot question (i'm new to unity, don't blast me LMAO): is there a way to slow down the cycle? Thanks a lot
EDIT: I found out the way to do it, if someone else needs it, you just need to multiply the Time.deltaTime in the TimeOfDay assignment for a number (if you want to slow it down it must be a number below 1, if you want to speed it up you'll need a number higher than 1)
ngl i stared at a red line in my code for 5 minutes before i released i had typed 0.1 and not 0.1f lol. Thanks for the help!
Подтверждаю - работает. Автор молодец
Is there a way to change the selected preset settings from the object with the script attached? kind of like how you can change a material's settings when you have selected an object in the scene that has that material asigned?
thanks really nice tutorial but how do i change the speed of it ?
any way to stop the light from clipping through the world when it turns night?
Have you found a solution?
awesome, thanks youfor your video)
The time and day cyclus works but there is an error in the script
(Error message) Invalid token in class, struct or interface member decleration
Hey! Good tutorial, thanks!
How can I change lighting preset with a unity event?
For example, I'm triggering rain with an event with delay, and I want to change the Lighting Preset to a more rainy sky colors. How can I do that?
probably make a second light that has a rain lighting, when its not raining have the normal one activated, otherwise activate the rain lighting.
Also it looks dark blue (even with color option), how can i solve this?
It would help me out if you showed what you opened from going to the script to the world because now I’m totally stuck
same
I cant seem to put the directional light into the Directional light slot? idk whats called, in the Lighting Manager, im new to lighting and need help
in the video misses the part where "SceneManagement" object is created (or i missed it)... i'm new to unity and i don't know what kinf of object scenmanagement is and how is created
I think it's using "create empty" to create an GameObject and add the script on it
@@Jary921 it worked, thanks
plz help. the Lightning Manager doesn't recognize my preset. it says me that it doesn't match filename
Hi!I have a question.I copied the exact same code that you put in the link but when i try to put LightingPreset script to Directional light it says "Script´s type not found".What can I do?
how do you make the gradients? and where did you attach the scripts? 😅
Is it possible to have a day/night cycle with baked lighting? I don't need to adjust the direction, just the ambient light color.
You can do it with precomputed realtime global illumination by just changing the ambient color, but to do the same with just baked global illumination you would probably need to write a custom shader.
@@618Lonewolf I was used mixed lighting mode and seems to work just fine.
Hey Glynn, awesome tutorial! I have a problem, the object in my hand changes color with the ambient color, and I can't find a way to solve this, if you could help me that would be awesome
How do you change the speed of the cycle?
By dividing or multiplying Time.deltatime for TimeOfDay by a number. Dividing or multiplying it by a number greater than 1 will slow the cycle down.
What app are you using to code, just curious.
Visual Studio 2022
Do you need a sun in order for it to work? code checks out no errors but the scroll does nothing on mine
i'm so confused... i'm running 2020 and i did all this coding and... now i'm getting errors on Gradient and Gameobject.... what did i do wrong?
Don't know what I'm doing wrong, but the sky doesn't change color for me.. I did everything the way you did and the lighting works, but the sky itself is one constant color
Hey do you know also how I can add the time that displays in the game?
What if you use Hdrp because it has no skybox and I can’t set it to Color?
Hi great video it really helped me but I had some questions
1- can I do something like this if it turns night I can turn on some lights something like this if (timeofday == 20)
{Findobjectoftype.getcomponent .setactive (true)
2-is there a way to add a moon and stars too the sky at night time really looks wired
How did you get yours to work? It wont let me create a scriptable for the Lightingmanager
@@squadsquad i had no problem with the scriptable object
ive did this, but the settings for the colors n that, my world is just all blue? i copied ur color settings
How would I program this to show many days have passed?
Thank you!
i followed your script code (which i only understand a little) but when writing the LightingManager script i cant use "[SerializeField] private LightingPreset Preset;" because it says that it cannot be found
It might be that you do not have the lighting preset script/class, or that there's no "using UnityEngine;" import at the top of the lighting manager script?
@@618Lonewolf I did and i made the preset i can even control it and added it on the preset manager, ill try watching your video again thanks for the reply
@@618Lonewolf Hey i finally got it working, but theres a problem with the shadows because whenever the sun gets to the low point there is shadow from the objects that are pointing up
im guessing it's because im using a plane as a terrain, do u have any fix for this?
@@jepubepu9570 Good to hear! Hmm you could probably either limit the angle that the sun can go down to, or reduce the light intensity of the directional light as it rotates towards that angle?
I encountered an error while creating the asset menu, please help me
Thank you.
I know this is an older video, but everything still seems to work great. I have a question if anyone is able/willing to help. Unity's UI is pretty different now so I'm not sure where these scripts should go. I put the lighting manager on the directional light and that made it work, but should it be elsewhere (maybe a game manager empty object)?
@Slumpy_is_here lighting manager on the light has been working well for me!
@@bryvoydatch8805so did you put the lightning manager on the directional light? I'm also using unity and it looks different now. Changing the colors or the time of day doesn't do anything in my game, it stays the same color. I added it on the directional light
epically
Might sound stupid.... but should it not be 0-23, since 0 is midnight n all? Doesn't this give you 25 hour days then?
I think you're thinking of integer values when you include both 0 and 24 (inclusive), since this is a float and the upper value is not included/exclusive (24 % 24 is 0) it's more of a range of 0 - 23.99999*.
trying to know why the lighting does not affect my background (I'm doing a mobile game so it's a 2D background)
Can anyone here help. My ground texture doesn't seem to change to a darker tone when it reaches night-time.
does this work in URP template?
thanks man.
Does this work for 2D game environments, too?
How do i get the DefaultPreset?
Thank you sooooo much
how to put a time text on the scenne?
I can't drag the lighting preset into the box
do you use directional light for this ?
problem is the shadows, make no sence they go everywhere
is there a way to add a moon that illuminates?
I did that by adding a second light facing the opposite direction, then making it a child of the sun. you might need to toggle between them to avoid shadow glitches.
is it Posible, 80% day and 20% night?
thanks