How to use light2d to hide a character in shadow because it's ugly. Godot lighting 2d tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024

ความคิดเห็น • 85

  • @RafaFiedo
    @RafaFiedo  4 ปีที่แล้ว +4

    Source code ;)
    github.com/rfiedorowicz/godot_light2d_tutorial

  • @KlausWulfenbach
    @KlausWulfenbach 4 ปีที่แล้ว +15

    I've done other tutorials on 2D lighting in Godot, but in just over three minutes you showed me a couple things I didn't know. Nice job!

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว +1

      Your welcome :D I'm glad that tutorial was helpful!

  • @clarityVALO
    @clarityVALO 3 ปีที่แล้ว +2

    Thanks so much for this, especially for having it be so concise. I REALLY was trying to figure out how to make players in shadow not appear until they’re on light like in Among Us, and the “light only” thing solved my problems. Thanks so much 👍

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว

      oh yea, I remember that I spend a lot of time to get this effect :D
      I'm glad that this video helped!

  • @AnthonyHarivel
    @AnthonyHarivel 4 ปีที่แล้ว +2

    Very nice !!!! thanks you for this. it's quick, goes to the essentiel and works !!! I had check other tutorials but stills I learned stuff here ! I love you games but they forces me to find other ideas ahah

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว +1

      Thank you! You can always write propositions of tutorials if you will not find what you are searching for ;)

    • @AnthonyHarivel
      @AnthonyHarivel 4 ปีที่แล้ว +1

      @@RafaFiedo I would be quite curious to know a bit more about Shaders and when to use them and why ?? Do you have any idea and that topic ?

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว +1

      It's great because I have plans to record a tutorial on how to start the adventure with 2d shaders ;)

    • @AnthonyHarivel
      @AnthonyHarivel 4 ปีที่แล้ว +1

      @@RafaFiedo Great !!! Thank you for all your time spending for sharing your gamedev knowledge :)

  • @cfrtarverdiyev5013
    @cfrtarverdiyev5013 3 ปีที่แล้ว +1

    Oh thanks, I was wandering how to make sun that's shining behind trees, very useful and short tutorial.

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว +1

      You're welcome Cəfər! :D

  • @matteoezrasmith
    @matteoezrasmith 4 ปีที่แล้ว +1

    Super awesome video! I'm really loving you channel! Keep up the awesome work! PLEASE!

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว

      Thanks!

    • @matteoezrasmith
      @matteoezrasmith 4 ปีที่แล้ว +1

      @@RafaFiedo Particle FX! Various shaders!

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว

      @@matteoezrasmith noted!

    • @matteoezrasmith
      @matteoezrasmith 4 ปีที่แล้ว +1

      Enemy AI and melee combat is something I look up a lot too.

  • @willwurtz
    @willwurtz 3 ปีที่แล้ว +1

    underrated channel. such great tutorial in just 3 minutes. Thank you kind sir. This channel will grow soon enough

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว

      Thanks! I'm glad that you like it :)

  • @ashfid8987
    @ashfid8987 4 ปีที่แล้ว +1

    Your game was beautiful when I tried it. Thank you for short tutorials!

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว

      You're welcome! New game is also in production ;)

  • @thanosch5
    @thanosch5 4 ปีที่แล้ว +1

    Keep up the good work. Love your videos about godot

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว

      Thanks! More is on the way ;)

  • @theprogrammar2844
    @theprogrammar2844 2 ปีที่แล้ว +1

    Perfect! Just what I needed for my level!

    • @RafaFiedo
      @RafaFiedo  2 ปีที่แล้ว

      Glad that tutorial helped!

  • @maikha8963
    @maikha8963 3 ปีที่แล้ว +1

    This title is my motto

  • @Macsmansion
    @Macsmansion 3 ปีที่แล้ว +1

    This tutorial was really good thanks :D Everything I needed!

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว +1

      No problem! The Next tutorial is on preperations :D

  • @domeen0gt895
    @domeen0gt895 4 ปีที่แล้ว +2

    Ill remember this :D

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว

      Good to know:D

  • @cristiandraghici6095
    @cristiandraghici6095 3 ปีที่แล้ว +1

    Thank you, very helpfull:D

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว

      Glad it helped!

  • @tictoktrending7184
    @tictoktrending7184 4 ปีที่แล้ว +1

    Man you are tallented

  • @gengami
    @gengami 3 ปีที่แล้ว +2

    You have really nice tutorial 😎
    I subscribed you !!!
    Keep it up 😉

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว +1

      Thanks for the sub "Infinity Senses"!
      Nice account name. What's the story of it?

    • @gengami
      @gengami 3 ปีที่แล้ว +2

      @@RafaFiedo Bro I just thought of something cool (Infinity) and you know our 5 senses...combining them is something cool...Thanks for asking ! I hope you liked it...

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว +1

      That remains me of the "captain planet" :D
      thanks for answer, have a nice day!

    • @gengami
      @gengami 3 ปีที่แล้ว +1

      @@RafaFiedo ☺️

    • @gengami
      @gengami 3 ปีที่แล้ว +2

      Bro I have a request please make a tutorial on dialogue system in Godot ( Like player talking to some other person )
      I hope you will think about it...

  • @annazadrozna9030
    @annazadrozna9030 4 ปีที่แล้ว +5

    Great joke with yellow submarine :P

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว +1

      More is coming in :D

  • @PekEsteban
    @PekEsteban 4 ปีที่แล้ว

    GREAT VIDEO!!

  • @samil679
    @samil679 3 ปีที่แล้ว +1

    actually what i wanted to look my game cool

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว

      I'm glad that it helped :D

  • @mrlonely420
    @mrlonely420 4 ปีที่แล้ว +1

    Hey man love your vids, can you do a tutorial on json and how to save the levels that you play, so when you hit continue in the menu, you change the scene to where you left off? thanks :}

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว +1

      Thanks man! Great ideas for short tutorials! I will add these ideas to my "near future tutorials" board ;)

    • @mrlonely420
      @mrlonely420 4 ปีที่แล้ว +1

      @@RafaFiedo that would be awesome man, thanks :)

  • @willwurtz
    @willwurtz 3 ปีที่แล้ว +2

    When I collide with something in a top-down game, the polygon on the occluder lights up instead of giving it a shadow. How to fix this?

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว +1

      Ah, I had the same problem in my "Dungeon Rescuer" game,. The solution would be level design.
      I solved this by achieving a situation where all occluders were connected with collision shapes (everything in auto title) so the player or just light source can't go inside the occluder.
      Unfortunately, I don't know a better solution.

  • @danielnortey5355
    @danielnortey5355 3 ปีที่แล้ว +1

    could you make a platformer tutorial

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว

      Hm... I have already recorded a few videos for the platform game like collisions, gravity.
      Are you interested on specific subject? About full platform game it would be a veeery long video ;)

  • @toaofnightmares
    @toaofnightmares ปีที่แล้ว +1

    is there a way to do this in 3d and godot4? I really cant seem to figure it out

    • @RafaFiedo
      @RafaFiedo  ปีที่แล้ว

      I have never tried this method on 3d ;/

  • @thechrom007
    @thechrom007 ปีที่แล้ว

    Hello! Why this method dont work now in Godot 4 ?

  • @georgemjose2426
    @georgemjose2426 4 ปีที่แล้ว +1

    How to hide things when exposed to light

    • @RafaFiedo
      @RafaFiedo  4 ปีที่แล้ว +1

      it's something similar to method I presented. For example you can add new light2d and range/item cull mask to another layer and in the light2d mode get "sub".
      Now in your sprite take material/canvasmaterials/ light mode - light only and ofcourse in visibility change light mask to same mask as second light
      and it's should work. You need only to experiment with the textures ;)

  • @rounak3811
    @rounak3811 3 ปีที่แล้ว

    I have got a problem when I am enabling shadows and play, the screen glitches like the Microsoft error meme! What should I do ?

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว

      What is the message on this errors?
      Have you tried run my project from the github?
      github.com/rfiedorowicz/godot_light2d_tutorial

    • @rounak3811
      @rounak3811 3 ปีที่แล้ว

      @@RafaFiedo right now I haven't tried running your project but I will try it now, I was following your steps and there is no error message just when I enable the shadows and run the scene everything that moves near the light 2d object starts glitching and when I don't enable shadows everything is fine except I don't get shadows. And I am using GLES2 cos my pc is kinda old. Are you on Instagram ? I can send the video to you..

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว

      Let me know if this project is working. Just to be sure that the shadows itself is a problem.
      ps. don't have instagram, but you can catch me on discord ;)

    • @rounak3811
      @rounak3811 3 ปีที่แล้ว

      @@RafaFiedo it's happening in your project too but inside your tilemap it's good and outside it happens again..Shall I send you the video on your discord?

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว

      yea sure, if you could do this.
      I'm curious to see it.
      Unfortunately I'm afraid that issue is beyond my knowledge, but let me see it first ;)

  • @ragreenburg
    @ragreenburg 3 ปีที่แล้ว

    My enemy characters aren't hidden when I choose "Light Only", any advice?

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว

      hard to say, because there can be a lot of reasons.
      Could you download my project and just compare it with your project?
      github.com/rfiedorowicz/godot_light2d_tutorial

    • @ragreenburg
      @ragreenburg 3 ปีที่แล้ว

      @@RafaFiedo Okay, the issue is I am adding a scene because it is an enemy and not a sprite. Do you happen to have a tutorial on how to do the same thing but with a scene rather than a sprite?

    • @ragreenburg
      @ragreenburg 3 ปีที่แล้ว +1

      @@RafaFiedo For what it's worth, I fixed it by just making the sprite the parent node of my kinematic body. I don't know if that'll cause issues down the line but it works!

    • @RafaFiedo
      @RafaFiedo  3 ปีที่แล้ว

      @@ragreenburg I am glad that you handled it! If you will have more questions let me know here or on the discord ;)

    • @ragreenburg
      @ragreenburg 3 ปีที่แล้ว

      @@RafaFiedo As it turns out, when trying to add more logic to the enemy it breaks because you can't call functions like is_on_wall from a sprite but the script also can't extend from the kinematic body. So I can only get stationary enemies with this setup. So I am lost again.