Тёмный

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

ThatOneUnityDev
Подписаться 5 тыс.
Просмотров 26 тыс.
50% 1

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:
pastebin.com/6Yfhy50x
Project: drive.google.com/file/d/1tCtq...
Want to talk to me, or other like minded developers?
Join The Discord: / discord
Buy me a coffee: ko-fi.com/thatoneunitydev
If you like the music in this video, you can get it from: www.epidemicsound.com/
Why isn't that like and subscribe button lit up? Smash it to oblivion!
------------------------
My Setup
PC: amzn.to/499LOMd
Drawing Tablet: amzn.to/3uhegNe
Microphone: amzn.to/4bqWkjX
Keyboard: amzn.to/3SvA2EV
Mouse: amzn.to/3wiriKF
Headset: amzn.to/3whZwxU
Desk: amzn.to/42Cot3w
Chair: amzn.to/489RIfc
Note: These products won't cost any more money than they typically would, but by clicking the link as an Amazon Associate, I earn commission from qualifying purchases.
------------------------
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

Игры

Опубликовано:

 

10 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 55   
@ThatOneUnityDev
@ThatOneUnityDev 3 года назад
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! :)
@mattrobb3566
@mattrobb3566 2 месяца назад
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.
@ThatOneUnityDev
@ThatOneUnityDev 2 месяца назад
Thank you for the kind words! I really appreciate it! Game dev is hard, I try to do what I can to help the community out! ❤️
@robertjunior5272
@robertjunior5272 2 года назад
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!
@Zereze
@Zereze 2 года назад
hey, how can i change(?) my project to a Universal render pipeline or add whatever its adding, because ive already created my project awhile ago and chose 2d as a template edit: ok i found how to add it, i found it on the package manager as "Universal RP" if there's anyone wondering edit 2: also you need to select UniversalRenderPipelineAsset on Scriptable Render Pipeline settings (edit/project settings/graphics) and Rendering (edit/project settings/quality)
@madhoshyagnik3222
@madhoshyagnik3222 2 года назад
May the algorithm bless you!
@masterlewzilla2116
@masterlewzilla2116 2 года назад
This is amazing! Thank you so much 🌠🌠👍
@pcd6music
@pcd6music Год назад
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
@a65tesla
@a65tesla Год назад
respect to you, you saved my nerves thank you very much for this method
@user-uu5xf5xc2b
@user-uu5xf5xc2b 2 года назад
you're the best tutorial youtuber i've seen tysm!!!!
@ThatOneUnityDev
@ThatOneUnityDev 2 года назад
Thank you so much! :)
@dandragomir6413
@dandragomir6413 2 года назад
awesome tutorial!
@rick6309
@rick6309 2 года назад
Vewry cool! You got a new follower! Thanks man. Gonna test it out!
@ThatOneUnityDev
@ThatOneUnityDev 2 года назад
Thank you very much! :)
@DevNoob
@DevNoob 3 года назад
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
@ThatOneUnityDev
@ThatOneUnityDev 3 года назад
Thanks so much! Yes post processing makes it so much easier, but most people don't think to use it! :)
@herecomedatboi4046
@herecomedatboi4046 Месяц назад
This was excellent, thank you!
@ThatOneUnityDev
@ThatOneUnityDev Месяц назад
Glad you liked the video! Thanks for watching! :)
@Fyres11
@Fyres11 Год назад
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.
@ThatOneUnityDev
@ThatOneUnityDev Год назад
Glad you liked the video! I tried to keep it as beginner friendly as possible, which meant just barebones not really optimized code. Ideally I would have made an actual asset out of it, which would of had a lot of customization options, and automation. I'm glad you were able to easily expand on what there was though!
@umuterguler8750
@umuterguler8750 Год назад
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 :(
@Serch28
@Serch28 2 года назад
thank you so much!!!
@lordbn0866
@lordbn0866 2 года назад
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?
@jaken96
@jaken96 2 года назад
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?
@hhcdghjjgsdrt235
@hhcdghjjgsdrt235 2 года назад
soooooooooo gooooooood
@dzdagato3893
@dzdagato3893 2 года назад
thanks man
@gamedevel22
@gamedevel22 2 года назад
Very useful tutorial Thanks! I will use this as a reference to create the new Day/Night cycle for my game Slimeland Evolution :D
@machebermejo4857
@machebermejo4857 2 года назад
This is amazing, thank you really much! You are a life saver!
@ThatOneUnityDev
@ThatOneUnityDev 2 года назад
Glad you enjoyed the video. :)
@sergeykudryashov9201
@sergeykudryashov9201 2 года назад
I don't have Volume button ((
@davidcalderwood7041
@davidcalderwood7041 2 года назад
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?
@zenoryx6540
@zenoryx6540 Год назад
I also had the second problem, have you found a fix for it?
@joenshoemaker
@joenshoemaker Год назад
@@zenoryx6540 idk if i'm too late but from what I've seen when you select Global Volume in the inspector there should be a checkbox titled "activate lights" and if you toggle that it should fix your issue
@Destroyanad
@Destroyanad Год назад
One fix could be changing the script to work with a global light instead of a post processing volume. Thats what i did, and it works just fine
@semajnz6549
@semajnz6549 Год назад
would it not be easier to do something like - time = Mathf.Sin(Time.time * value) * someothervalue; Or would this stupid, just wondering.
@davidmarques483
@davidmarques483 2 года назад
What software do you use to make your sprites?
@epro252
@epro252 Год назад
same question
@masterlewzilla2116
@masterlewzilla2116 2 года назад
Btw. How can I track or snychronize the time betweem scenes? I guess i need to store the time somewhere globaly and load it between the scene? Sry I m very new :)
@ThatOneUnityDev
@ThatOneUnityDev 2 года назад
No problem, a simple solution is to use player prefs. :)
@NotBree
@NotBree 2 года назад
Sir, what app use to art the character
@ThatOneUnityDev
@ThatOneUnityDev 2 года назад
I used a free program called piskel. :)
@NotBree
@NotBree 2 года назад
@@ThatOneUnityDev sir can u make tutorial make flappy bird
@NotBree
@NotBree 2 года назад
Sir can i ask, why i drag the photo piskel in unity is blur if i
@tallwitheighteyes
@tallwitheighteyes 8 дней назад
@@NotBree as its pixel art you want to turn off compression and set the filter mode to Point (no filter) in the inspector, that should stop it being so blurry
@Krishna-bz5iz
@Krishna-bz5iz 2 года назад
its not working on android, anyway to fix it ?
@ThatOneUnityDev
@ThatOneUnityDev 2 года назад
Thanks for watching! :) .. It's possible you may not have post processing enabled in your graphics tier settings.
@Krishna-bz5iz
@Krishna-bz5iz 2 года назад
@@ThatOneUnityDev I enabled it. done everything from start to end but nothing works then I created a new project with urp instead of 2d or 3d then imported my project and now its working :)
@ThatOneUnityDev
@ThatOneUnityDev 2 года назад
@@Krishna-bz5iz Glad to hear you got it working! :)
@iii-tf6rc
@iii-tf6rc 3 года назад
This has nothing to do with my project but still liked the video for support :D
@ThatOneUnityDev
@ThatOneUnityDev 3 года назад
Haha, thank you!
@johnrasc6544
@johnrasc6544 3 года назад
NICEE
@a65tesla
@a65tesla Год назад
Какая проблема... Слишком тускло светит лампа
@a65tesla
@a65tesla Год назад
Просто вот в никакую... Вообще нет point light 2D
Далее
Unity 2D Cloth! No Code Needed!
6:37
Просмотров 13 тыс.
Watch THIS Is You're Going To Make A 2D Game
11:05
Просмотров 25 тыс.
Creating a Day/Night Cycle (Unity Tutorial)
20:28
Просмотров 42 тыс.
Simple Day Night Cycle for 3D Open World Games
8:06
Unity DAY AND NIGHT In 6 Minutes!
6:31
Просмотров 95 тыс.
Day and Night Cycle - Quick Setup
8:16
Просмотров 9 тыс.
What size should your assets be? | HD 2D GAME ART
12:10
Unity - 2D Melee Combo System Tutorial
22:15
Просмотров 70 тыс.
10 Minutes vs. 10 Years of Animation
19:29
Просмотров 593 тыс.
A new way to generate worlds (stitched WFC)
10:51
Просмотров 514 тыс.
У ПОУ РОДИЛСЯ РЕБЕНОК в ROBLOX!
19:43