How To Make A 2D Day/Night Cycle - Unity

preview_player
Показать описание
I have always admired day night cycles, and have made a few in the past. This is an easy way to get a good result!

Code:

Want to talk to me, or other like minded developers?

Why isn't that like and subscribe button lit up? Smash it to oblivion!

Timestamps
0:00​ Introduction
0:05 End Result
0:19 Inspiration
0:29 What we will be covering
0:46 Sprites
1:09​ Project Setup
1:37 Dressing The Scene
1:55 Post Processing
2:49 2D Lights
3:13​ Code
4:08 Outro
Рекомендации по теме
Комментарии
Автор

I hope you guys liked the video! Don't forget to like and subscribe. If you want to talk to me, or other like minded developers, head on over to the discord. The link is in the description! :)

ThatOneUnityDev
Автор

Excellent, thank you. You showed that a cool, professional effect is much easier to achieve than most people would think! And thanks for even sharing the code rather than only releasing it to patreons.

mattrobb
Автор

probably, I mean definitely, the best tutorial about day and night cycle I've ever watched. Concise and very well explained. Thank you for this!

robertjunior
Автор

For anyone struggling to find the option to convert to URP, it's because as of Unity 2021.3 they changed where it's located. It is now under Window > Rendering > Render Pipeline Converter

Check off "materials and material reference upgrade" and select "initialize converters" - this will select all the assets to be converted
Then select "Convert Assets"

And yes, this step IS crucial in getting lights to work

pcdmusic
Автор

Nice. Took chunk of the code to update my own. You could use Interface to make it more modular. In my case the building lights got a specific script turning them on and off and they find themself all the lights on the building. The Main script only need to find all the objects with the BuldingLight script and call that function to turn them on or off.

FyresGames
Автор

you're the best tutorial youtuber i've seen tysm!!!!

深夜-lf
Автор

i have a problem when using the script.

the volume resets every time I go into play mode and i have to set it manually again.

how can I fix this?

lordbn
Автор

This is amazing! Thank you so much 🌠🌠👍

masterlewzilla
Автор

Very nice tutorial! Here to show some support :D In the past I messed around way too much with lights whatnot. Using post processing makes it so much nicer

DevNoob
Автор

Heyy thank you for your tutorial. I have a question for you. How can i add shadows this project shadow caster is doesn't working :(

umuterguler
Автор

Vewry cool! You got a new follower! Thanks man. Gonna test it out!

rick
Автор

this videos kinda old but is it possible to shade the sky and not have it one single color so maybe it’s a bit lighter closer to the horizon?

jaken
Автор

This is amazing but I have a couple of questions on it.

1. The Spot Lights I have created seem to be affected by the global volume. How can I set them to be a static brightness. Because right now when the world is getting back to daylight brightness, the spot lights are also getting much brighter.

2. The lights don't work turning on and off until day 2. So during day 1 at midday when the scene is bright, the spot lights are still on. How can I fix this?

davidcalderwood
Автор

Very useful tutorial Thanks! I will use this as a reference to create the new Day/Night cycle for my game Slimeland Evolution :D

gamedevel
Автор

This is amazing, thank you really much! You are a life saver!

machebermejo
Автор

would it not be easier to do something like - time = Mathf.Sin(Time.time * value) * someothervalue;
Or would this stupid, just wondering.

semajnz
Автор

This has nothing to do with my project but still liked the video for support :D

iii-tfrc
Автор

What software do you use to make your sprites?

davidmarques
Автор

Sir, what app use to art the character

NotBree
Автор

2d core needed how to make day night cycle not urp
, in core no direction light

WorldwideAffairs