Skip to content

u/geowarin

In this archive from Feb 2021 to Jun 2025

2
posts
9
comments
1
media
219
score

Top posts

Top comments

Layer and mask are represent as a single number.

This is possible thanks to a bitmask and is mentioned in the docs: https://docs.godotengine.org/en/stable/tutorials/physics/physics_introduction.html#code-example

So when you want to have something on layer 1, you check the first layer and this creates a binary number like: 0001, which is 1 in decimal.

If you want to have something on layer 2, you check the second layer. With the following binary: 0010, which is 2 in decimal.

This allows you to have something on multiple layers. For instance, if you want to have something BOTH on layer 1 and 2, you get the following binary: 0011, which is 3 (2+1) in binary.

Hope that helps.

1 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.