Godot Collision Layers and Masks… the EASY Way

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

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

  • @ChaoszZChannel
    @ChaoszZChannel 8 месяцев назад +16

    Great stuff, a lot of tutorials tend to forget that physics layers exist or never care to explain how it works.

  • @AbyssMerchant
    @AbyssMerchant 8 месяцев назад +7

    Thank you for the vid! Too many times have randomly clicked on the layers and masks hoping stuff just "clicks together" lol

  • @OHTASISAN
    @OHTASISAN 7 месяцев назад +5

    This was a great video. The structure was incredibly easy to follow along with and seeing the practical applications visually really let it sink in for me. Keep up the good work!

    • @baconandgames
      @baconandgames  7 месяцев назад +2

      Oh gosh. Thank you so much. YT is a rough gig. I don’t know how much you realize comments like this mean. 🥹

  • @nkbdl
    @nkbdl 4 месяца назад +1

    Good and decently short video. I think it is great that a tutorial focuses on one single topic instead of trying to do too much. Thanks.

    • @baconandgames
      @baconandgames  4 месяца назад +1

      Thanks! I like the one topic format as well 🙂

  • @ravveni
    @ravveni 8 месяцев назад +2

    really appreciate all the various examples of using collision layers and masks! awesome tutorial!

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

      🤜🤛 I’m glad you found it helpful!

  • @GameDevJourney
    @GameDevJourney 2 месяца назад +1

    Great video, Bacon - really helpful! Would love to see the video about the interactions in code.

    • @baconandgames
      @baconandgames  2 месяца назад +1

      Thanks! I’ll add that to my list.

  • @mrussogamedev
    @mrussogamedev 7 месяцев назад +2

    thanks, great video. Layer and Mask is one of Godot features that much like Tileset is overwhelming at first glance, really take effort to grasp it but once you get used to it it all makes sense.

    • @baconandgames
      @baconandgames  7 месяцев назад

      You’re welcome! Thanks for watching and for the kind words. 🙏

  • @birbothealpha
    @birbothealpha Месяц назад

    wow you are seriously a fantastic teacher, you explained all of this better than 99% of the tutorials i have watched on here

  • @marcusgray3525
    @marcusgray3525 6 месяцев назад

    Thanks for putting together such an easy to follow tutorial. I enjoyed the way you presented the material and didn't make me feel like I was absolutely losing my mind trying to understand this topic. Subscribed!

    • @baconandgames
      @baconandgames  6 месяцев назад

      Thank you, thanks very kind of you to say!

  • @taronzgaming7739
    @taronzgaming7739 6 месяцев назад +1

    I'm very new to game development and coding in general. I'd be very keen to see you tutorialize a project like you mentioned here, as you seem to do a good job at explaining what you're doing and why!

    • @baconandgames
      @baconandgames  6 месяцев назад +1

      Hey, thanks so much! I've been trying to come up with a small project to take folks through start to finish (aside from my Snake tutorial from when I first started the channel) ruclips.net/video/c7HQwxs5y8w/видео.html
      Stay tuned. And good luck with your gamedev journey! If you get stuck, please come by the Discord and we'll do our best to help out.

  • @RG-ef8vm
    @RG-ef8vm 5 месяцев назад

    Wow. I didn't know the Extra Credit differentiation between setting the layer on a crate, vice setting the mask on the crate, and the wildly different results from the collision with the player. Thanks for that...and your video as a whole.

    • @baconandgames
      @baconandgames  5 месяцев назад

      You're very kind. Thanks for watching and for the kind words. Good luck with your project!

  • @murifox_
    @murifox_ 7 месяцев назад

    I think you are probably one the best godot/gamedev teachers that I discover searching for these topics.
    Keep up the great work!

    • @baconandgames
      @baconandgames  7 месяцев назад

      Aw geez. Thank you. What a kind thing to say. 🥹

  • @valeriacalzona9830
    @valeriacalzona9830 3 месяца назад

    very useful video! it helped me understand quickly and easily the difference between the two and how to use them. thank you very much

    • @baconandgames
      @baconandgames  3 месяца назад

      I’m so glad! Good luck with your project 👏

  • @GenTink
    @GenTink 7 месяцев назад

    This is so well put and easy to understand. Thank you. Fantastic video.

    • @baconandgames
      @baconandgames  7 месяцев назад

      I appreciate that. Thank you 🙏

  • @mrserlysir
    @mrserlysir Месяц назад

    thanks for the video it helped me understand the physics layers and how to think about godot

  • @jakerosper9239
    @jakerosper9239 7 месяцев назад

    Great explanation and examples! I needed that. Yes do another vid on the coding side of interactions please.

  • @gunaruni4564
    @gunaruni4564 5 месяцев назад

    Oh my god, you saved me! I for the love of god do not know what is collision layer and mask, so thank you!

    • @baconandgames
      @baconandgames  5 месяцев назад +1

      I know that feeling (and I still struggle from time to time with it). I'm glad this helped! Good luck with your project!!!

  • @alexxander7289
    @alexxander7289 3 месяца назад

    i like the way you place the URL of the tutorial video in your guthub projects. ty!
    i also really like it when you put timestamps in your videos. ty ty !!
    AND I REALLY REALLY appreciate it when you separate you projects from version 1 and version 1.1+ ty ty ty !!!

    • @baconandgames
      @baconandgames  3 месяца назад

      You’re welcome you’re welcome ☺️

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

    Sick video! This will be super handy for beginners learning about collisions

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

      Aww. That’s the hope. Thanks so much for watching! 🙏

  • @YCLPaiva
    @YCLPaiva 6 месяцев назад +1

    thank you! it helped me a lot

  • @ince55ant
    @ince55ant 7 месяцев назад

    my brain just refuses to absorb this stuff. (like i do it at start of project in a way i never have to really deal with again)
    so its good to have wee reference vids i can watch while having a coffee

    • @baconandgames
      @baconandgames  7 месяцев назад

      I love that. I’m renaming the channel to Bacon and Games and Coffee 😀

  • @LaurenHowellNCC1701D
    @LaurenHowellNCC1701D 2 месяца назад

    Thank you! Very helpful :)

  • @_Tabled
    @_Tabled 3 дня назад +1

    Very cool and helpful

  • @Manuelarte
    @Manuelarte 16 дней назад

    excellent tutorial!

  • @tronalddump8442
    @tronalddump8442 6 месяцев назад

    Wonderful tutorial, helped me out a bunch! But just wondering whether you could do a tutorial on how to make pushable objects for a top down game like you did with the rock above the secret ladder.

    • @baconandgames
      @baconandgames  6 месяцев назад

      I think this video covers it but let me know if you get stuck:
      ruclips.net/video/FSOh-yH2FyA/видео.html

  • @seasonphan
    @seasonphan 5 месяцев назад

    great video!

  • @ZB_95
    @ZB_95 7 месяцев назад

    thank you! earned a sub

  • @toniok.4726
    @toniok.4726 7 месяцев назад

    Too underated ❤❤

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

    Yep, I just remember that the top one is not for detection. It's odd sure but that's how I keep it in mind, I am super lazy about naming them though. >.

    • @baconandgames
      @baconandgames  8 месяцев назад +1

      Naming is a good practice to get into and it doesn’t take that long. Be kind to your future self. Name your layers and masks. 🌈

  • @DeadIndGames
    @DeadIndGames 7 месяцев назад

    Is this a project you are working on or just something you threw together for this video? I have an idea for a 2D game and some of these concepts you showed would translate to my idea really well and was wondering if you had the project files available?

    • @baconandgames
      @baconandgames  7 месяцев назад

      It’s a prototype I’m working on but I’m not very far along. I’ll give you a copy of the project if you want.

    • @DeadIndGames
      @DeadIndGames 7 месяцев назад

      @@baconandgames I would love that!!

    • @baconandgames
      @baconandgames  7 месяцев назад

      @DeadIndGames drop into my Discord and shoot me a DM. I’ll zip it up for you.

    • @DeadIndGames
      @DeadIndGames 7 месяцев назад

      @@baconandgames okay when I get a chance to hop on I'll do that! Thanks!

    • @baconandgames
      @baconandgames  7 месяцев назад

      @DeadIndGames 👍

  • @J3ff_K1ng
    @J3ff_K1ng Месяц назад

    if you want to do the free travel thing but with multiple object how would yo do it?
    because idk if godot creates a different "script" per obj so Im not sure about changing the script in case it affects every instance

    • @baconandgames
      @baconandgames  Месяц назад

      I would probably use composition. You’d create a node that can be dropped onto any object that might “care” about being in free travel. It probably wouldn’t do much more than handle that flag and allow you to read or write it. Then, whenever relevant, then you could check for whether an object is part of that system with has_method (one of many ways to check if an object adheres to some standard such as being a part of the “free travel” system you’ve written) and then act accordingly. Godot is full of ways (perhaps too many) to set up these kinds of systems. You could have a group that you apply to things that need to be part of free travel (and you can add/remove things from groups all the time), you could use metadata (I don’t recommend this, but sometimes it makes sense), you could even use inheritance to bubble up this property to anything you want as part of your “free travel” system. Godot is designed to allow you to mix inheritance and composition, but I feel like it favors composition more. You might find this video on composition v inheritance very helpful: ruclips.net/video/74y6zWZfQKk/видео.html

    • @J3ff_K1ng
      @J3ff_K1ng Месяц назад

      @baconandgames I think I get it, I'm gonna code it and see what happens
      Thank you so much

    • @baconandgames
      @baconandgames  Месяц назад +1

      @J3ff_K1ng That’s the right answer! Nothing beats trying it yourself. Good luck! If you get stuck or want feedback, please come by the Discord (link in bio) and someone will give you a nudge :) Happy coding!

  • @godofdream9112
    @godofdream9112 4 месяца назад

    how to ensures that the mouse input will not interact with the bottom Area2D when the top Area2D is overlapping. same node instances.

    • @baconandgames
      @baconandgames  4 месяца назад

      Hi there. I'm sure the issue you're trying to solve is more complex than you've shared here so it's going to be tough to give you an answer. Have a look at the "pickable" property. That may help.

    • @godofdream9112
      @godofdream9112 4 месяца назад

      @@baconandgames i solved my problem using button instade of area2d... however here is my problem in detail...
      terget: multiple playing_card instance with area2d, when mouse entered on that card that card should bounce a little to indicate you are on that card.
      problem: now every thing is working, but IF YOU HAS 2 CARD PARTIALLY ON TOP OF EACH OTHER, BOTH OF THEM ARE BOUNCING. where i wanted to mask out active area of down_card with top_card.
      like if visually you are not on top a card, that card should not do the bouncing.
      I hope, i am more or less successful to tell you the problem.

    • @baconandgames
      @baconandgames  4 месяца назад

      @godofdream9112 my guess is you have code on each card node that’s handing that bouncing you described. One way to solve this problem is not to let each card, which know nothing about out each other, manage that behavior. If you had a manager that all the cards reported into looking at “which one is being hovered” it to make sure that only the one you want shows the effect you’re after. So the cards would report information about how/when they’re being interacted with and the manager would have access to their properties and could decide for ALL cards how each cards behave. Think of it like a conductor in an orchestra being responsible for keeping time for everyone playing, rather than each musician having their own metronome.

  • @diotone5580
    @diotone5580 3 месяца назад

    Can you do one on Tilemap layers? Tilemap is deprecated.

    • @baconandgames
      @baconandgames  3 месяца назад

      I would but the change is negligible. Tilemaps have layers contained within them as a drop down. Tilemap layers are those layer drop downs exploded into individual nodes. That’s really the main difference. Everything else in this video applies to TilemapLayers.

    • @diotone5580
      @diotone5580 3 месяца назад

      @@baconandgames Okay I'm very new to this engine so I thought it was major change. I added a physic layer 0 to a couple of tiles but my character can still walk over them instead of being blocked. I made sure I added the necessary collision layers to the Tilemap and Player. Does your Hero node contain another component affecting collision?

    • @baconandgames
      @baconandgames  3 месяца назад +1

      @diotone5580 find me in my Discord channel. I’ll give you the project so you can see how I have it set up. 😃

    • @diotone5580
      @diotone5580 3 месяца назад

      @@baconandgames Will do, thanks!

  • @blasttrash
    @blasttrash 4 месяца назад

    I think they shouldnt have called it "mask". I think they were using the programming terms(since its a bitwise mask). Instead they should have called it something else I think

    • @baconandgames
      @baconandgames  4 месяца назад

      I suspect you are correct about that