Unity DAY AND NIGHT In 6 Minutes!

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • Let's make a simple day/night cycle controller in Unity3D!
    Brackeys did a great intro to scriptable objects: • SCRIPTABLE OBJECTS in ...
    LightingPreset.cs
    gist.github.co...
    LightingManager.cs
    gist.github.co...
    I've removed my patreon, here's a github link to the full project: github.com/Gly... with a unity package here: github.com/Gly...

КОМЕНТАРІ • 185

  • @lildgamedev6885
    @lildgamedev6885 3 роки тому +155

    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.

    • @Rubberduckerino
      @Rubberduckerino 3 роки тому

      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?

    • @zekerton7262
      @zekerton7262 2 роки тому +8

      @@Rubberduckerino Window -> Rendering -> Lighting -> Environment -> Source

    • @thunderx2153
      @thunderx2153 2 роки тому

      can you explain how you did it pls?

    • @lildgamedev6885
      @lildgamedev6885 2 роки тому +2

      @@thunderx2153 Comment above u tells u how to switch to lighting source to color

    • @pursuer7632
      @pursuer7632 2 роки тому

      how can we slow the proces down like suppose i want 1 day in my game to be like 1 minute long?

  • @c0d3d85
    @c0d3d85 5 років тому +38

    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.

    • @618Lonewolf
      @618Lonewolf  5 років тому +1

      Glad you liked it :D Thanks!

  • @VeryOddFellow
    @VeryOddFellow 2 роки тому +4

    I love the people that give code for free, don't stop coding!

  • @AvitheTiger
    @AvitheTiger 4 роки тому +5

    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!

    • @ndejesus34800
      @ndejesus34800 4 роки тому +1

      @Avi the Tiger
      Do you have github to see how it's work ?

    • @jackal9393
      @jackal9393 6 місяців тому

      @@ndejesus34800he just told how it’s working

  • @lildgamedev6885
    @lildgamedev6885 3 роки тому +20

    Bruh this dude is like a coding GOD. I paused like 50 times trying to keep up lol

  • @Orionhart
    @Orionhart 7 місяців тому

    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.

  • @VRwithAndrew
    @VRwithAndrew 5 років тому +5

    Nice work, Glynn! Simple, and certainly looks good enough to get the job done. :)

    • @618Lonewolf
      @618Lonewolf  5 років тому

      Thanks a bunch! I love the simpleness of it and how quick you can change the colours :D

  • @Palerider1011
    @Palerider1011 5 років тому +6

    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.

    • @618Lonewolf
      @618Lonewolf  5 років тому +2

      Thanks I'm glad you liked it :D I feel that too, alot of hour long tutorials out there XD

  • @SnutiHQ
    @SnutiHQ 5 років тому +3

    Very nice tutorial, like how you structured the data and used validators, never kneew this was even possible! 😱 This is awesome!! 😁👍 🌜🌞

    • @618Lonewolf
      @618Lonewolf  5 років тому +2

      Thanks, I'm glad it had some useful tidbits! :D

  • @sadravin1
    @sadravin1 3 роки тому +3

    Excellent, this is exactly what I was looking for, and it is simple to use. Thank you.

  • @mathiasbruin3336
    @mathiasbruin3336 4 роки тому +4

    Straight to the point and a clear explanation, great tutorial

  • @joshvanwyk4987
    @joshvanwyk4987 2 роки тому +1

    Thanks for this great video! Really easy to follow and does it's job wonderfully

  • @SuperDutchrutter
    @SuperDutchrutter 3 роки тому +2

    Fantastic walkthrough! Thank you :D

  • @Zukomazi
    @Zukomazi 4 роки тому +1

    Thanks this works perfect for a open world project I'm developing

  • @SuHomunculoRiko
    @SuHomunculoRiko 4 роки тому +3

    This is perfect for my project, thx!

  • @capybaratech377
    @capybaratech377 2 роки тому

    Thank you for your help Mr. Glynn. God bless

  • @theuniverse.9867
    @theuniverse.9867 8 місяців тому

    This is a really good tutorial, thank you bro

  • @mikesellers4355
    @mikesellers4355 3 роки тому +10

    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

    • @franmartiini3862
      @franmartiini3862 2 роки тому

      saved my life, Thanks S2

    • @ghostarda6355
      @ghostarda6355 2 роки тому

      hi thx but the lightingupdate does not exist can someone help pls??

  • @ElectroGehirn
    @ElectroGehirn 2 роки тому +12

    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

    • @beorgames7802
      @beorgames7802 Рік тому

      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

    • @ElMoy
      @ElMoy Рік тому +2

      @@beorgames7802 Why not just multiply the value of timeOfDay by some speed variable?

    • @dattebayo2000
      @dattebayo2000 7 місяців тому +1

      i am a beginner so do we set TimeOfDay% = 600f or just erase it all and write 600

    • @ElectroGehirn
      @ElectroGehirn 7 місяців тому

      @@dattebayo2000 Hi, i am no longer into unity stuff i forget everything about that, sorry

    • @dattebayo2000
      @dattebayo2000 7 місяців тому

      its alright :)@@ElectroGehirn

  • @pausenabre1077
    @pausenabre1077 4 роки тому +7

    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?

  • @Dragon-ki2xl
    @Dragon-ki2xl 4 роки тому +3

    1:52 the fart

  • @aw_dev
    @aw_dev 4 роки тому +12

    How do you make the cycle slower?

  • @nevercanyoucant
    @nevercanyoucant 2 роки тому +2

    I cant figure out how to get those multi colored gradients at 1:52.... ;___;

  • @serkidedan
    @serkidedan 4 роки тому +5

    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.

  • @samisalama3033
    @samisalama3033 3 роки тому

    DUDE thank you so so so so so much you are life saver thanks for the tutorial thank you so much

  • @konainthetech8920
    @konainthetech8920 4 роки тому +3

    Thanks You Bro..You Help Me a lot..🥰

  • @csab_csab123
    @csab_csab123 Рік тому

    Great tutorial, thank you so much! :)

  • @johnabend7042
    @johnabend7042 2 місяці тому

    the hardest part of this video is figuring out how you actually got that screen to pop up in the inspector.

  • @bennetkonig2713
    @bennetkonig2713 5 років тому

    Just the right thing i need for Ludum Dare 45 xD
    thx m8

  • @Ben-gp1dm
    @Ben-gp1dm 3 роки тому +5

    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

    • @michealt6837
      @michealt6837 3 роки тому +1

      when the time of day = a certain time play a new sound

  • @hva3422
    @hva3422 3 роки тому

    wild tutorial I love it thanks so much

  • @CraigHoward
    @CraigHoward 4 роки тому +3

    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!

  • @НиколайНикакоюс-л2ь

    Подтверждаю - работает. Автор молодец

  • @squadsquad
    @squadsquad 4 роки тому +1

    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?

  • @Tudvari
    @Tudvari 4 роки тому +1

    Thanks, bookmarked!

  • @Crazmer
    @Crazmer 4 роки тому +7

    How to slow down the speed of time of day function

    • @juli12345istRecorsi
      @juli12345istRecorsi 4 роки тому +6

      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

    • @Steelersfan355
      @Steelersfan355 3 роки тому

      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

  • @alexorbh7
    @alexorbh7 4 роки тому +3

    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.

    • @618Lonewolf
      @618Lonewolf  4 роки тому +2

      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!

  • @holyxskillz1793
    @holyxskillz1793 3 роки тому +2

    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?

  • @bogdanel5843
    @bogdanel5843 4 роки тому +1

    I LOVE ITTT!! THX SO MUCHHHH!! New Subbbb

  • @adi-chandra
    @adi-chandra 3 роки тому

    Thanks Glynn! :D

  • @pursuer7632
    @pursuer7632 2 роки тому +1

    how can we slow the proces down like suppose i want 1 day in my game to be like 1 minute long?

  • @dyl3841
    @dyl3841 3 роки тому +2

    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

  • @arashsh4513
    @arashsh4513 4 роки тому +6

    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

    • @618Lonewolf
      @618Lonewolf  4 роки тому +15

      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!

  • @ludovicoleardi2268
    @ludovicoleardi2268 3 роки тому +12

    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)

    • @paulwhitelock5895
      @paulwhitelock5895 3 роки тому +3

      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!

  • @ElCurios
    @ElCurios 2 роки тому +1

    Everything works fine, except when the "sun" is at its 0 the floor turns completely black and that doesnt look that great, any idea?

  • @squadsquad
    @squadsquad 4 роки тому +2

    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

  • @manuelsarmentero9895
    @manuelsarmentero9895 4 роки тому +2

    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?"

  • @McSirrington
    @McSirrington 3 роки тому

    Great video thank you so much sir

  • @mygamingimagination8173
    @mygamingimagination8173 4 роки тому +3

    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

    • @mr.ndreson3759
      @mr.ndreson3759 3 роки тому +1

      You need to create an empty game object and assign the lightnin manager script to it. You cant directly assign objects to the script

  • @barbosaur
    @barbosaur 4 роки тому +2

    Tutorial is nice. Can you give me your lighting preset please?

  • @saturn3150
    @saturn3150 Рік тому +1

    What app are you using to code, just curious.

  • @omegavolta
    @omegavolta 2 роки тому +1

    question, how do i make it so there's no fog in between sunrise and sunset?

  • @michaelchurch2957
    @michaelchurch2957 4 роки тому +5

    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?

    • @funnyvideoslive9721
      @funnyvideoslive9721 4 роки тому +1

      its been 5 months and dude still hasn’t got an answer

    • @oozly9291
      @oozly9291 3 роки тому

      @@funnyvideoslive9721 it’s been 9 months now

    • @m0dd3dtut0rials5
      @m0dd3dtut0rials5 3 роки тому

      @Crimson Gaming 1 year and 6 months

    • @redcoin4853
      @redcoin4853 2 роки тому

      @@m0dd3dtut0rials5 1 year and 7 months XD

    • @diggerpy
      @diggerpy Рік тому

      @@redcoin4853 2 years

  • @riftcutter
    @riftcutter 4 роки тому +1

    nice work, you earn a sub

  • @OpxGames
    @OpxGames 8 днів тому

    problem is the shadows, make no sence they go everywhere

  • @mikethegamedev
    @mikethegamedev 3 роки тому

    Thank you!

  • @ross673
    @ross673 3 роки тому

    awesome, thanks youfor your video)

  • @Animework
    @Animework 4 роки тому

    Thank you.

  • @brucemashbat7378
    @brucemashbat7378 3 роки тому +2

    How do you change the speed of the cycle?

    • @mohammadtausifrafi8277
      @mohammadtausifrafi8277 3 роки тому +1

      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.

  • @MtbFL
    @MtbFL 2 місяці тому

    ive did this, but the settings for the colors n that, my world is just all blue? i copied ur color settings

  • @normancollonvilleburger9668
    @normancollonvilleburger9668 3 роки тому +1

    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?

    • @racking570
      @racking570 3 роки тому

      probably make a second light that has a rain lighting, when its not raining have the normal one activated, otherwise activate the rain lighting.

  • @tudypie
    @tudypie 4 роки тому +1

    Hey do you know also how I can add the time that displays in the game?

  • @brunobelli5541
    @brunobelli5541 4 роки тому

    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

  • @FC12CGaming
    @FC12CGaming 3 роки тому +1

    How do i get the DefaultPreset?

  • @supergoo_
    @supergoo_ 2 роки тому

    epically

  • @djkaalo248
    @djkaalo248 4 роки тому +1

    does this work in URP template?

  • @Red-de5jg
    @Red-de5jg 4 роки тому +2

    I've followed just about everything but how do you get to the menu that allows you to control the time of day?

    • @Hikk
      @Hikk 4 роки тому +2

      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

    • @Miska19
      @Miska19 4 роки тому +1

      @@Hikk Thank you so much for that because I was racking my brain on that!!

    • @pauntum
      @pauntum 3 роки тому

      @@Hikk Thank you so much!

  • @Slort_
    @Slort_ 3 роки тому

    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

  • @NjecolinaHranjec
    @NjecolinaHranjec 5 місяців тому

    Does this work for 2D game environments, too?

  • @Shotnoms
    @Shotnoms Рік тому

    thanks really nice tutorial but how do i change the speed of it ?

  • @SonsOfMars-Game
    @SonsOfMars-Game Рік тому

    any way to stop the light from clipping through the world when it turns night?

  • @velvaraart1007
    @velvaraart1007 3 роки тому

    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?

  • @knos2938
    @knos2938 3 роки тому

    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

  • @rkplanet4079
    @rkplanet4079 3 роки тому

    Thank you sooooo much

  • @Freno.99
    @Freno.99 Рік тому

    plz help. the Lightning Manager doesn't recognize my preset. it says me that it doesn't match filename

  • @Dertres
    @Dertres 3 роки тому

    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

  • @LuquidLumination
    @LuquidLumination 3 роки тому

    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?

  • @CAESAR_IS_GOD_mohammadisaloser
    @CAESAR_IS_GOD_mohammadisaloser 3 роки тому

    Do you need a sun in order for it to work? code checks out no errors but the scroll does nothing on mine

  • @goohbr
    @goohbr Рік тому

    thanks man.

  • @bananaaudio
    @bananaaudio 2 роки тому

    Not sure why, but the changes are not parsing in the editor, only when I hit play.

  • @alikaangul5602
    @alikaangul5602 2 роки тому

    How would I program this to show many days have passed?

  • @callit6801
    @callit6801 2 роки тому

    trying to know why the lighting does not affect my background (I'm doing a mobile game so it's a 2D background)

  • @zarojanualexandru1503
    @zarojanualexandru1503 3 роки тому

    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?

  • @Wonderchocolate
    @Wonderchocolate 3 роки тому

    What if you use Hdrp because it has no skybox and I can’t set it to Color?

  • @Wabbaxt
    @Wabbaxt 3 роки тому

    do you use directional light for this ?

  • @fianDev
    @fianDev 2 роки тому

    I encountered an error while creating the asset menu, please help me

  • @xenen9797
    @xenen9797 3 роки тому

    I can't drag the lighting preset into the box

  • @Gejam_GameDev
    @Gejam_GameDev 2 роки тому

    thanks

  • @cloudy42069
    @cloudy42069 2 роки тому

    3:44 checkpoint

  • @LordBaaleos
    @LordBaaleos 3 роки тому

    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?

    • @618Lonewolf
      @618Lonewolf  3 роки тому +1

      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*.

  • @runedova126
    @runedova126 3 роки тому

    Can anyone here help. My ground texture doesn't seem to change to a darker tone when it reaches night-time.

  • @abhinavduparestudios5995
    @abhinavduparestudios5995 2 роки тому

    How to change the time to make it 1hr day /1hr night and then reset.

  • @gmg-merlinserbe7464
    @gmg-merlinserbe7464 3 роки тому

    is it Posible, 80% day and 20% night?

  • @onestepdown2475
    @onestepdown2475 2 роки тому

    is there a way to add stars?

  • @rheakim2949
    @rheakim2949 Рік тому

    how to put a time text on the scenne?

  • @ArcadeRenegade
    @ArcadeRenegade 3 роки тому

    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.

    • @618Lonewolf
      @618Lonewolf  3 роки тому

      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.

    • @ArcadeRenegade
      @ArcadeRenegade 3 роки тому +1

      @@618Lonewolf I was used mixed lighting mode and seems to work just fine.

  • @marcodianti4399
    @marcodianti4399 3 роки тому

    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

    • @Jary921
      @Jary921 3 роки тому +2

      I think it's using "create empty" to create an GameObject and add the script on it

    • @MarcoDianti
      @MarcoDianti 3 роки тому

      @@Jary921 it worked, thanks

  • @heroalireza90
    @heroalireza90 4 роки тому

    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

    • @squadsquad
      @squadsquad 4 роки тому

      How did you get yours to work? It wont let me create a scriptable for the Lightingmanager

    • @heroalireza90
      @heroalireza90 4 роки тому

      @@squadsquad i had no problem with the scriptable object

  • @josephgonzalezgarrido153
    @josephgonzalezgarrido153 4 роки тому

    is there a way to add a moon that illuminates?

    • @velvaraart1007
      @velvaraart1007 3 роки тому +1

      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.

  • @oldbutgold4462
    @oldbutgold4462 4 роки тому

    is this works with 2d ? rpg games