2D Lights in Unity!

Поделиться
HTML-код
  • Опубликовано: 14 ноя 2024

Комментарии • 866

  • @Brackeys
    @Brackeys  5 лет назад +131

    Hi Everyone! Just sharing the signup-link for the boot camp! academy.zenva.com/brackeys

    • @ciscoandhenry2635
      @ciscoandhenry2635 5 лет назад

      hey Brackeys sometime could you try out a 2D coding program called stencyl because i love stencyl but all the other video
      guides are terrible (by the way you can code with java on it it's not just block coding) .

    • @rikkurco
      @rikkurco 5 лет назад +1

      This is perfect! Been looking for more VR courses online, especially after Udacity removed their VR nanodegree programs. Thank you!

    • @devision-studio
      @devision-studio 5 лет назад

      @Brackeys Hello! Could you please make a video on how to get haptic in a mobile game? It would help me out so much if you could make a tutorial.

    • @michaelwieland3221
      @michaelwieland3221 5 лет назад

      I got a problem with light rendering with Normalmap. I get the 3d lightning effect on my 2d sprite, only in my Scene view, but not in Game view or in the exported game. I'm using Unity 2019.3.0a6.

    • @luhanimations
      @luhanimations 5 лет назад

      Only global lights are working on my project, help!! :(

  • @mnnm1989
    @mnnm1989 3 года назад +1175

    It is called universal render pipeline now, just in case anybody is wondering

    • @abalorias333
      @abalorias333 3 года назад +20

      Thanks! I was a bit confused looking through videos

    • @totalnubs1148
      @totalnubs1148 3 года назад +9

      Thank you! I was also just searching for it too lmao

    • @alvin4100
      @alvin4100 3 года назад +2

      Thanks

    • @QiwiYuna
      @QiwiYuna 3 года назад +3

      thanks, this really helped me

    • @PixelbugStudio
      @PixelbugStudio 3 года назад +3

      Thanks man.

  • @Tall_Order
    @Tall_Order 4 года назад +398

    For anyone confused in 2020 LWRP uses URP as a dependency so when you create your Pipeline Asset and 2D Renderer, they're both in Create > Rendering > Universal Rendering Pipeline. Everything else should work as described.
    Edited on 5/20/20: I'm sure this will change at some point. If it has by the time you're reading this; disregard it.

    • @afromosh7495
      @afromosh7495 4 года назад +3

      thx man exactly my problem

    • @Keanine
      @Keanine 4 года назад +6

      You actually don't need the LWRP if you already have URP to do everything in this tutorial

    • @Rhino123freak
      @Rhino123freak 4 года назад +24

      Thank you lovely fellow, I hope you get laid a lot.

    • @oleslav07
      @oleslav07 4 года назад

      Thanks a lot

    • @peterl1202
      @peterl1202 4 года назад +1

      Thanks, bro! It confuses me a lot

  • @alexandermassaro8331
    @alexandermassaro8331 2 года назад +84

    The Upgrade part is now under Window -> Rendering -> Render Pipline Converter
    You also need to add a 2D Global Light, set the intensity to 0.
    This makes everything Dark

    • @valeriekolb7918
      @valeriekolb7918 Год назад

      oh my god thank you for that global light comment

    • @b33bo93
      @b33bo93 11 месяцев назад

      or set it to 1 if you want everything to be light :-)

    • @tenebrusnoirceur6343
      @tenebrusnoirceur6343 8 месяцев назад

      You saved me !

  • @mitulmahish6145
    @mitulmahish6145 2 года назад +44

    For Everybody's Good, who are using New versions of unity
    Lightweight render pipeline is now URP
    && after assigning pipeline asset in Project Settings
    >>> Create a new "Renderer > Universal Render Pipeline > 2D Renderer"
    >>> Select your URP pipeline asset (the one first created)
    >>> Inspector > General > Render List > Add the 2d Renderer
    >>> Set it to Default

  • @Nyck0s
    @Nyck0s 5 лет назад +321

    Hey Brackeys, great video! Would love to see more 2D stuff like this

  • @micaheberz6020
    @micaheberz6020 3 года назад +43

    If anyone is confused, it is now called Universal RP

  • @flappyBoi
    @flappyBoi 2 года назад +24

    Updated as of (09/07/2022) : from the package manager, import the Universal render pipeline project, in assets do : * create>rendering>URP2D renderer * then Edit > Project Settings, and select the Graphics category. Set the Scriptable Render Pipeline Settings __to your created __Pipeline Asset __by dragging the Asset directly onto the box, or by selecting the circle icon to the right of the box to open the __Select Object window and selecting the Asset from the list.

  • @clamum
    @clamum 5 лет назад +58

    Frickin Brackeys man. I think he's the happiest person I've ever seen

  • @metall7331
    @metall7331 5 лет назад +6

    I was literally looking for a unity 2d light tutorial a few hours ago for the game I'm making. I found a solution using diffuse material and point lights, but to be honest I not too pleaded with the way it looks. You are a life saver man!

  • @zasharan2
    @zasharan2 4 года назад +3

    I looked it up, clicked on the video, and as the information loaded I thought "I bet it's gonna be Brackeys."
    I was not disappointed!

  • @danielweber4961
    @danielweber4961 5 лет назад +6

    WOW, this new 2D lighting looks amazing. I can not wait to play around with this. Thanks always for bringing us top Unity news Brackeys!

  • @omerhijazi498
    @omerhijazi498 4 года назад

    he's so calming and understandable
    and if you ever stop at any particular second at parts where his face is shown you will get what you will get when typing "happy calm man" on Shutterstock/Getty
    :)

  • @taaamas7785
    @taaamas7785 5 лет назад +11

    I've been having recent issues with 2d lighting, thanks for this :)

  • @simonsemmler9804
    @simonsemmler9804 3 года назад +1

    the best tutorials that ever existed

  • @NETRUNNER_03
    @NETRUNNER_03 5 лет назад +8

    I literally was looking for this last night.
    Stop reading my mind brackeys!!

  • @gridgaming_
    @gridgaming_ 4 года назад +4

    Brackeys is so awesome
    *drags in massive light* "so lights on, its showtime"

  • @GameDevNerd
    @GameDevNerd 3 года назад

    Kind of off topic but a handy trick in Visual Studio is to hit Shift + Alt + Enter whenever you need to focus on nothing but one script for a moment. It full-screens the editor box and eliminates all distractions. Hit the same keys to return to normal view. It helps me a lot.

  • @SneezeyHey
    @SneezeyHey 3 года назад

    the intros just makes my day

  • @trevsweb
    @trevsweb 5 лет назад

    Glad you added the note about shadows cause all the way through I was thinking about them.

  • @mihirdesai2144
    @mihirdesai2144 4 года назад

    YOU HAVE DONE INCREDIBLE JOB IN TEACHING GAME DEVELOPMENT.
    ENJOY YOUR BREAK.

  • @NathanSifuGaming
    @NathanSifuGaming 5 лет назад

    Are... are you kidding me? A channel that’s... pretty much EXACTLY what I’m hoping for as somebody who’s planning on making a game for the first time? I’d sub twice if I could :D

  • @CodeGaff
    @CodeGaff 5 лет назад +12

    This is perfect and great timing too! Just as I start creating my first 2D game :D
    Great video as always Brackeys, thanks!

  • @Dani_Krossing
    @Dani_Krossing 5 лет назад +57

    Great video. However when it comes to using Tilemaps, the Tilemaps doesn't register the changes at all.
    When everything is supposed to turn black, it is only the non-Tilemap assets that are affected and turn black :/
    My Tilemaps just remain unaffected as if I never used the 2D rendering shown in this video.
    Guess this means no more Tilemaps until there is 2D light support for it? Or am I missing something?

    • @lolesch
      @lolesch 5 лет назад +35

      [SOLVED] you can create a new material and set the shader settings up yourself. there is a new entry for Lightweight Render Pipeline/2D/Sprite-Lit-Default. Drag that into your Tilemap Renderer and there you go

    • @factorial.
      @factorial. 4 года назад +1

      @@lolesch thanks

    • @xXSummonNightXx
      @xXSummonNightXx 4 года назад

      Creating a new material and adjusting the shade to add to your tile map renderer doesn't work for me.

    • @zaidmermam2524
      @zaidmermam2524 3 года назад +1

      @@lolesch you are a fricking legend

    • @lolesch
      @lolesch 3 года назад

      😘

  • @danielwilkins1147
    @danielwilkins1147 3 года назад +1

    Goshdangit. Brackeys was just too good for RUclips.

  • @akstis4183
    @akstis4183 5 лет назад +2

    i know english very bad, but your courses is very understandable, and i understand what you say. Thanks you for this

  • @wssoup
    @wssoup 3 года назад +7

    Took me a long time to find out, but if you are also on Unity 2020.1, install Universal RP from the Unity Registry part of the Package Manager.

  • @elijahlittrell7241
    @elijahlittrell7241 4 года назад +1

    if y'all were confused about why you couldn't change it from forward {R} to custom {R}, its cuz its changed, you just need to make the 2D experimental {R}, then put that in where the pipeline asset is supposed to go.

    • @ScilexGuitar
      @ScilexGuitar 4 года назад +1

      what do you mean by "make the 2D experimental" ?

    • @elijahlittrell7241
      @elijahlittrell7241 4 года назад +1

      Thats just how it’s labeled, it says (I think) “2D (experimental)

    • @ScilexGuitar
      @ScilexGuitar 4 года назад

      @@elijahlittrell7241 Thanks but I still get the problem that when I drag a sprite it isnt completely black like Brackeyz did

  • @Targetnetnews
    @Targetnetnews 3 года назад +1

    Thanks to this video. I can finally create my 2D flashlight...🤩

  • @TimbavatiLion
    @TimbavatiLion 5 лет назад +9

    Oh my god this is EXACTLY what i needed for my new 2D game idea that has units with flashlights, where everything outside the flashlight cone is invisible.
    I was wondering how to do that... and it just became so easy 😂

    • @albingrahn5576
      @albingrahn5576 5 лет назад +3

      Selmokk If you want a little bit more control over the effect you could always use sprite masks, here’s a great tutorial by blackthornprod: m.ruclips.net/video/4pl8DcsCQ_k/видео.html Though I’m sure using lights will work just as well

    • @voidling2632
      @voidling2632 5 лет назад

      @@albingrahn5576 sprite mask dont support transparency

    • @zachpetersen9250
      @zachpetersen9250 4 года назад

      Just have a large ui element covering the screen except for the beam. But this works too.

  • @brentooo
    @brentooo 5 лет назад +7

    If using Unity Versions 2019.3.0a8 or .0a7 I believe, you will have Compile Errors when Installing the LWRP, so be aware. Hopefully save someone some hair tearing confusion.
    Went into the files and tried to fix it by overwriting some of the problems, but there was a few that I could not fix, so hopefully Unity Patches it up. Best options is to use Unity 2018.2 such as Brackey’s did in this video or use the traditional method with a 3D point light and materializing Sprites.

  • @druidofpies
    @druidofpies 5 лет назад

    Alright, buddy. This is getting spooky how you're releasing videos on EXACTLY what I'm currently working on and am having questions about. Excellent video and helped me out a lot!

  • @spartanh1438
    @spartanh1438 5 лет назад +1

    just what I needed
    love Brackeys

  • @lisandromarinelli
    @lisandromarinelli 5 лет назад +1

    Congratulations for your appearance in Black Mirror!

  • @visclo4782
    @visclo4782 4 года назад +1

    thank you! your tutorials are always easy to follow and straight to the point ^^

  • @GameDevNerd
    @GameDevNerd 3 года назад +1

    Wow, RUclips was on autoplay and I'm working on a 2D micromanagement game about managing land in medieval time and was thinking "Hmmm, how to do day and night cycles in 2D ..." then I heard Brackeys say something about how to use lights in 2D 😄

  • @looserdev
    @looserdev 5 лет назад +5

    Thank You Brackeys! That was JUST the video i needed :)

  • @igorthelight
    @igorthelight 5 лет назад +3

    Great!
    Godot 3 has 2D lighting a few years ago. Now Unity have it too!

  • @TheScorpionAly
    @TheScorpionAly 3 года назад +11

    If your sprites are not black or dark after following the steps, I might found a solution:
    First of all, make sure you have sprites lit default attached to your scene sprites, you can do it manually or do as it's shown at 4:39
    After that, select your camera, and under Rendering -> Renderer select the 2D renderer object that you created
    And finally, make sure to have the little lightbulb at the top left (Next to 2D view) active, and in that way you will always see scene lighting active.
    Good luck, have fun!

  • @rejoentwm6398
    @rejoentwm6398 5 лет назад +2

    I've been waiting for this for so long! :D thx!

  • @danieljurys1336
    @danieljurys1336 5 лет назад +9

    Tomorrow I am going to start a game jam where I have to make a 2D horror game and this beautiful video shows up
    Thank you, dood

  • @GusBoone
    @GusBoone 5 лет назад +49

    Can you make a tutorial on fire movement? (Waving, crackles, etc.)

    • @MrSirFluffy
      @MrSirFluffy 5 лет назад

      Probably involves a script updating the settings on the light object.
      Like fluctuating the intensity and color.

    • @Tokw11
      @Tokw11 5 лет назад +2

      @@MrSirFluffy Probably better to make an animation that changes light values.

    • @MrSirFluffy
      @MrSirFluffy 5 лет назад

      @@Tokw11 Do settings change in animation? If so that would work too.

    • @Tokw11
      @Tokw11 5 лет назад

      @@MrSirFluffy I believe so. Just hit that record button and see what goes red

    • @anubhavgupta3562
      @anubhavgupta3562 5 лет назад

      @@MrSirFluffy yes

  • @michaelwieland3221
    @michaelwieland3221 5 лет назад

    OMG finally we get 2d Lightning. Looks really awesome in your video, I gonna try it out right away

  • @icetrooper4875
    @icetrooper4875 5 лет назад

    It looks so great! Now we're waiting for shadows.

  • @thugTaters
    @thugTaters 5 лет назад +1

    I don't even game dev but I find all of this stuff interesting and watch anyways lol

  • @saintsaladeunauthorizedspa6562
    @saintsaladeunauthorizedspa6562 5 лет назад +1

    I love the way you say "renderer"

  • @gmikhail94
    @gmikhail94 5 лет назад

    Can't wait for the shadows

  • @wayaway7234
    @wayaway7234 5 лет назад +13

    I love you man! You breathtaking! And this - just what i need!!!

  • @joshuamekeel4975
    @joshuamekeel4975 5 лет назад +12

    If anyone is wondering why this wont work on a tile map; simply delete the tilemap and create a new one if you had a tilemap before implementing the lighting assets then you have to make a new one

    • @jannis6061
      @jannis6061 5 лет назад

      Thanks man

    • @Mondgewitter
      @Mondgewitter 5 лет назад +4

      You can also just change the material on your tilemap to Sprite-Lit-Default.

    • @joshuamekeel4975
      @joshuamekeel4975 5 лет назад

      @@Mondgewitter Oh really? I tried this before but it didn't do anything. maybe I did something wrong.

    • @yacinekahlerras1973
      @yacinekahlerras1973 5 лет назад +1

      @@Mondgewitter couldn't find the material when i tried to change it so i went to the Tilemap Renderer clicked right and selected Reset and it automatically changed the material to Sprite-Lite-Default

    • @JayClark
      @JayClark 5 лет назад

      @@Mondgewitter That's what I did, works like a charm: Lightweight RP/Runtime/Materials

  • @amateurinteractive1381
    @amateurinteractive1381 5 лет назад

    You're a life saver @brackeys!

  • @dadlord689
    @dadlord689 5 лет назад

    Awesome. Unity does doing good work. It is just a matter of skills to make it run smoothly.

  • @zentergames1622
    @zentergames1622 5 лет назад

    This lights make 2D games cool

  • @Elias-cd5vg
    @Elias-cd5vg 5 лет назад +127

    Please make an Local Multiplayer Tutorial in 2D

    • @Damian_DH
      @Damian_DH 5 лет назад +25

      online 2D would be cool too xD

    • @Nik-gv4mh
      @Nik-gv4mh 5 лет назад +1

      yeah it would be very nice!

    • @AnselmoSB
      @AnselmoSB 5 лет назад

      In Unity/learn i believe i saw something like that these days. It´s worth to search fof

    • @holmbergen
      @holmbergen 4 года назад +1

      It's even easier creating local multiplayer using the new input system. Just slap a PlayerInputManager-script in your scene and reference your Player prefab (that must have a PlayerInput-script on it) and it should work.

  • @franzjacobhernandez186
    @franzjacobhernandez186 4 года назад

    OMG this video came just in time. Making a 2d survival horror game for GGJ2020 and I've been using 3d point lights. THIS is SO much better, and EASIER. HOLY CRAP TY

  • @MMMercia
    @MMMercia 4 года назад +1

    Really cool!

  • @Nik-gv4mh
    @Nik-gv4mh 5 лет назад

    Thank you for detailed explanation! Waiting for shadows feature!

  • @spadexmagic8297
    @spadexmagic8297 5 лет назад

    Amazing content Brackeys! I amend you for your free content and helpful tutorials. Your channel started my career as a game developer. Thanks again bro.

  • @TheDeatrockerRoom
    @TheDeatrockerRoom 3 года назад

    As always - just the best

  • @ladispl
    @ladispl 5 лет назад

    omg you have no idea how much i needed this tutorial (sry for bad english)

  • @GamesBySaul
    @GamesBySaul 5 лет назад +1

    I literally tweeted yesterday about having to learn how to do lights in Unity for 2D projects and now this?
    Did Brackeys see my tweet? No chance in hell.
    Is it a coincidence? I think so.
    Hotel? Trivago.
    Seriously thanks for the vid! :D

  • @squidfrick2239
    @squidfrick2239 5 лет назад +1

    I had trouble with 2D lights thanks for helping!

  • @ErtBaran
    @ErtBaran 5 лет назад

    Really thanks so much, Brackeys.

  • @AlwaysEast
    @AlwaysEast 5 лет назад

    Really really really really really really awesome!

  • @4EGKingstone
    @4EGKingstone 5 лет назад +5

    Finally, that is the feature I always wanted

  • @karficzfrizack2711
    @karficzfrizack2711 5 лет назад

    Thanks, been so excited to see this since it was announced :D

  • @Helphisha10000
    @Helphisha10000 4 года назад

    To make sure 2d lightning works, delete completely settings folder which has default renderer

  • @Moonz97
    @Moonz97 5 лет назад

    This feature is lit!

  • @JiwonSong95
    @JiwonSong95 4 года назад

    This is Sooo Amazing This works so well even if there are some changes
    Lightweight RP is now Universal Render Pipeline, and there is some hierarchy changes!

  • @Mazahas
    @Mazahas 5 лет назад +2

    I just love this channel, it always appear with explanations that can help me increase the quality of my projects

  • @oldshamen
    @oldshamen 5 лет назад +1

    Wee .. that is my knight sprite used at the 13:00 mark .. from my RayWenderlich tutorial on Procedural Dungeons .. Really cool :D

  • @jeanjacquesstrydom
    @jeanjacquesstrydom 5 лет назад +1

    I wish unity's 2D renderer existed last year when I worked on my first game

  • @noponn8007
    @noponn8007 5 лет назад

    ohmygod he uploaded another 2d tutorial thank you mr. Brackeys, CEO of Brackeys

  • @aidanbirmingham7566
    @aidanbirmingham7566 5 лет назад

    I LOVE you videos they really have helped me to learn and love unity. You inspire me everyday

  • @surftijmen
    @surftijmen 5 лет назад +1

    thank you again !

  • @eboo12
    @eboo12 5 лет назад +1

    I like how you say rendered, Renderah

  • @flyer2707
    @flyer2707 2 года назад +6

    I upgraded my project to the Universal Render Pipeline but my sprites where not turning black in the game.
    It turns out that you need to have at least one 2D light!

  • @Dyzinel
    @Dyzinel 5 лет назад

    You're making me happy, thanks.

  • @kingreinhold9905
    @kingreinhold9905 5 лет назад

    Sweeeet! 2D shadows would also be an interesting topic!

  • @charliekennedy4216
    @charliekennedy4216 5 лет назад +1

    Great video!

  • @2snakiroo337
    @2snakiroo337 5 лет назад +1

    *I love you Brakeys*

  • @hawdk1102
    @hawdk1102 5 лет назад

    Brackeys elsker dine videoer

  • @danzouph1695
    @danzouph1695 5 лет назад +1

    Hi Brackeys! Thank you for all the tutorial you do for us. I started game developing because of you! 😄 This is my first time asking but, can you do a video about SMS or Messenger style in Unity?

  • @Real_MrDk
    @Real_MrDk 5 лет назад

    YE thanks for tuning as BRACKEY YOUR OLD MEMORIES... BTW AWESOME VIDEO 😀😀😀🤣🤣🤣☺️😄😄

  • @stretch343
    @stretch343 5 лет назад

    Lights up my day

  • @lora3459
    @lora3459 3 года назад +1

    The "wohoo!" at 04:58 is just so adorable! Please come back to make more amazing videos, I found your channel just a few days ago and you're by far the best content creator I've ever seen!

  • @kalyanboro467
    @kalyanboro467 5 лет назад +2

    Is the T-shirt you're wearing designed by "BlackThornProd"? Because the graphic resembles his Art style!!

  • @Beast_theGymRat
    @Beast_theGymRat 4 года назад

    Great video really very helpful...... U should do a series on 2d game that contains all the required techniques and all the other stuffs.... Thanks.

  • @tzisorey
    @tzisorey 5 лет назад

    Sweet - that'll come in handy for a project I'm working on for xmas!

  • @NuNaKri
    @NuNaKri 4 года назад

    Thanks, very good tutorial

  • @gusdeveloper
    @gusdeveloper 5 лет назад +2

    Thank you very much, it is exactly what I was looking for!
    In the next video can you show how to create normal map textures?
    Your videos are awesome!
    Regards

    • @vegitoblue2187
      @vegitoblue2187 5 лет назад

      Convert to grayscale and blur. This will work unless you are trying something more complex or precise

  • @ceramango6483
    @ceramango6483 4 года назад

    30 seconds in i gotta subscribe bc wholesome teacher

  • @maryuma881
    @maryuma881 4 года назад +1

    Just mentioned that you can put some shadow to object using component "Shadow Caster 2D"

  • @n.karamousadakis
    @n.karamousadakis 5 лет назад +2

    Great job man! Thank you for making this video :-)

  • @teambrunomir
    @teambrunomir 5 лет назад +1

    Hey Brackeys! As allways I love your videos! By any chance do you plan on doing a tutorial about how to create that normal texture that you talked about? Or do you already have one regarding that subject?
    Thanks!

  • @justinn9570
    @justinn9570 5 лет назад +45

    I don’t even need to know this but I watch it anyways

  • @Kaldrin
    @Kaldrin 5 лет назад +1

    That's pretty amazing ! :o
    Thank you !

  • @dwexecutioner
    @dwexecutioner 4 года назад

    Even if now unity uses URP, the video still helps, thank you :)

  • @madifoldstudio8064
    @madifoldstudio8064 5 лет назад

    Saved me loads of time of creating light maps etc. Thanks! I also had to update to a beta, but...okay.

  • @hoigaming90
    @hoigaming90 4 года назад +3

    I liked this video, appreciate it much, but I really want to know how they create the light and shadow for pixel art with "pixelated" shadow as in the "Pathway" game.
    Please make a video about it....

  • @watagree
    @watagree 5 лет назад

    Are you guys ever going to make a full game. I would like to see what you guys are capable off.