Godot Engine - Collision Layer and Mask

  Рет қаралды 22,207

Pigdev

Pigdev

Күн бұрын

Understanding how collision layers and masks work in Godot Engine is a key skill to develop, especially if you want to make action games. In this video you are going to understand the difference between layers and mask, how to name them to keep your project organized and some features you can implement using these features.
Support me on Patreon: / pigdev
Link to jump through experiment: pigdev.itch.io/experiments/de...
Link to devduck's devlog: • Beginnings of Sailing ...
Join Discord: / discord
Become Patron: / pigdev
Follow on itch: pigdev.itch.io/
Follow on twitter: / pigdev
---
00:00 - Intro
01:14 - Briefing collision layers and masks
01:29 - Bumping enemy
03:20 - Player detection
04:45 - Naming physics layers
05:51 - Stomp mechanic (?)
06:07 - set_collision_layer and set_collision_mask
06:35 - Intro to pass through mechanics
06:57 - Platformer series goal
07:23 - Outro
---

Пікірлер: 44
@chaoscifer1483
@chaoscifer1483 2 жыл бұрын
Thank you! I was really confused about layers and masks but now everything makes sense!
@pigdev
@pigdev Жыл бұрын
It's kinda...confusing yeah! It took me some time as well.
@whanethewhip
@whanethewhip 2 жыл бұрын
This is helpful, been wondering what the layer and mask values do under collision. Do you have a video tutorial that explains how to detect a player collision with the environment when the player is a rigid body?
@pigdev
@pigdev Жыл бұрын
RigidBodies report collisions with a builtin signal if I remember correctly
@iWhisperASMR
@iWhisperASMR Жыл бұрын
Thanks. Very helpful!
@user-xs1bv6ns5b
@user-xs1bv6ns5b Ай бұрын
Great tut!
@pigdev
@pigdev Ай бұрын
Thank you for watching! 😁
@lksxxtodin5292
@lksxxtodin5292 10 ай бұрын
Thank You! Loved your channel
@pigdev
@pigdev 9 ай бұрын
Thanks for watching ~ I'm glad you enjoyed it, hope it's been helpful!
@silentkillaa2673
@silentkillaa2673 2 жыл бұрын
This is a nice course... Thanks!
@pigdev
@pigdev Жыл бұрын
Thanks for watching!! Glad it helped!
@DavidPeterWorks
@DavidPeterWorks 3 жыл бұрын
I enabled and disabled collision shapes in most of my games. Godot complains about deferring these calls. Playing with bit masks looks like a nice solution. Thank you.
@pigdev
@pigdev 3 жыл бұрын
Did it work? I never thought about doing that way 😅
@DavidPeterWorks
@DavidPeterWorks 3 жыл бұрын
@@pigdev It did, but not as cool as collision layers and masks. :)
@pigdev
@pigdev 3 жыл бұрын
@@DavidPeterWorks I mean the collision layer/masks approach 😅 I also use the CollisionShape.disabled = true/false approach
@MatheusSouza-lo8ty
@MatheusSouza-lo8ty Жыл бұрын
Layer: Others can detect you Mask: You can detect others
@pigdev
@pigdev Жыл бұрын
I'd say: Layer: where I am Mask: what I see
@comnrade
@comnrade 3 жыл бұрын
Poderia traduzir pra português Brasil? Ajudaria muito
@user-rw2dj2qt2v
@user-rw2dj2qt2v Жыл бұрын
Very Big Thank
@pigdev
@pigdev 11 ай бұрын
No problem! I'm glad it help!
@stefanogrillo6040
@stefanogrillo6040 3 жыл бұрын
Your pronounciation is good bruh. thanks 4 the tutorial.
@pigdev
@pigdev 3 жыл бұрын
Thank you! Really glad to read that. ❤
@cuca_dev
@cuca_dev 3 жыл бұрын
Nice content, since it's a basic feature that a lot don't understand. I thought you took too much time to explain it though, which can sometimes generate more confusion of the topic.
@pigdev
@pigdev 3 жыл бұрын
Thanks for the feedback! I'm too verbose indeed, will try to improve that.
@skaaarlate
@skaaarlate 4 ай бұрын
Caraca vey tava pensando q era sotaque br e fui ver o canal e era msm aduhaudhasd.
@pigdev
@pigdev 3 ай бұрын
Desde 2016 tentando falar ingles sem sotaque e falhando miseravelmente kkkkkkkkkkk
@conta7619
@conta7619 2 ай бұрын
Eu percebi na hora ksksksksksksks
@Kingsblood
@Kingsblood 3 жыл бұрын
Still wondering whether unity or godot are better!
@conta7619
@conta7619 2 ай бұрын
@voteforhamsandwich1112
@voteforhamsandwich1112 8 ай бұрын
Collision layer: "which layer am i in?" Collision mask: "in which layer do i look for others?" Pro tip: name layers according to what they are, dont use default layer names
@novalodos1224
@novalodos1224 Жыл бұрын
Renaming not working at all. I think its now dameged with some updates
@pigdev
@pigdev Жыл бұрын
Are you using Godot 3.5+? If so, try Project -> Project Settings -> Layer Names -> Physics 2D
@D.E.Nicolas.Goncalves
@D.E.Nicolas.Goncalves 11 ай бұрын
I suspect pigdev is a brazilian brasileiro
@D.E.Nicolas.Goncalves
@D.E.Nicolas.Goncalves 11 ай бұрын
aswell, thanks for the video! it was helpfull
@pigdev
@pigdev 7 ай бұрын
Suspeita é? kkkkkkkk Eu não escondo isso, tem até um bocado de vídeos antigos em PT-BR
@saulnores3477
@saulnores3477 3 жыл бұрын
5:54 you don't explain. It's the only part I was interested in.
@pigdev
@pigdev 3 жыл бұрын
you mean the stomp? It's simple, two lines of code. What didn't you understand exactly?
@saulnores3477
@saulnores3477 3 жыл бұрын
@@pigdev I don't understand how it works get_slide_collision(0).collider. What I'm trying to find is a video that shows how to change collision masks through code. So that I apply the masks only when I need it. Espero você possa comprender. Muito obrigado.
@pigdev
@pigdev 3 жыл бұрын
​@@saulnores3477 for that I recomend this devlog, the way we can do jump through mechanics is by enabling/disabling collision masks/layers in run time through code. pigdev.itch.io/experiments/devlog/164052/jump-and-fall-through-platforms
@pigdev
@pigdev 3 жыл бұрын
@@saulnores3477 watch 6:35 to 6:57 segment. It Would be helpful if you watched the whole video.
@saulnores3477
@saulnores3477 3 жыл бұрын
@@pigdev Muito obrigado.
@ecti1010
@ecti1010 4 ай бұрын
I came to learn how to make objects collide.. not "not collide".. now I'm more infuriated 😑💔
@pigdev
@pigdev 4 ай бұрын
If you know how they not collide you know how they collide 🤷🏻‍♂️
#GodotEngine - Endless Scrolling Background
10:46
Pigdev
Рет қаралды 15 М.
BETTER 2D visuals in 7 EASY TIPS
10:38
MrEliptik
Рет қаралды 64 М.
Smart Sigma Kid #funny #sigma #comedy
00:26
CRAZY GREAPA
Рет қаралды 12 МЛН
Using Composition to Make More Scalable Games in Godot
10:13
Firebelley Games
Рет қаралды 209 М.
How Games Make VFX (Demonstrated in Godot 4)
5:46
PlayWithFurcifer
Рет қаралды 327 М.
Godot Shader Tutorial [Basics] in 7 minutes
7:47
Master Albert
Рет қаралды 89 М.
PhD AI student explains how China already have won in AI..
13:28
livinlavidaluke
Рет қаралды 66 М.
Is Stardew Valley Worth it? - Steam Refund Review
12:24
SuperMurse Gaming
Рет қаралды 2,4 М.
How to Code Melee Attacks in Godot: Hitboxes and Hurtboxes
15:11
6 Tips to Better Organize your Godot Projects
11:39
GDQuest
Рет қаралды 133 М.
How You Can Easily Make Your Code Simpler in Godot 4
6:59
Bitlytic
Рет қаралды 382 М.
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,8 МЛН
Как распознать поддельный iPhone
0:44
PEREKUPILO
Рет қаралды 2,1 МЛН
Худшие кожаные чехлы для iPhone
1:00
Rozetked
Рет қаралды 1,4 МЛН
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 6 МЛН
Kumanda İle Bilgisayarı Yönetmek #shorts
0:29
Osman Kabadayı
Рет қаралды 964 М.