#Godot 4.1.3 Collision2d set_collision_layer_value()
14 messages · Page 1 of 1 (latest)
That's the documentation I'm seeing in the editor for CollisionObject2D. So you should be able to do something like
object.set_collision_layer_value(1,true)
Where "1" is what layer you want to enable/disable, and "true" being whether you want it enabled or disabled
So just a random example would be obj.set_collision_layer_value(5,false) instead of the layer's value attribute?
I'm pretty sure you have to use the value. So 16 if you want to turn on layer 5. Try it out in your code and check the values of the Remote using the inspector.
Actually. i dont know
try both of them and check the values in the inspector at runtime
Is that the debugger behind the game popup?
Nvm i know what you mean, i didnt know that updated in real time with the scene running
here is a link to a video example I gave someone else not too long ago
#programming message
5 Appears to work from a visual examination (in game), 16 doesn't appear to work at all and neither updates the inspector when running the game
I'm sure 16 does something, because you're supposed to be able to use values between 1 & 32