@@ -114,7 +114,7 @@ Collision layers and masks
114
114
One of the most powerful, but frequently misunderstood, collision features
115
115
is the collision layer system. This system allows you to build up complex
116
116
interactions between a variety of objects. The key concepts are **layers **
117
- and **masks **. Each ``CollisionObject2D `` has 20 different physics layers
117
+ and **masks **. Each ``CollisionObject2D `` has 32 different physics layers
118
118
it can interact with.
119
119
120
120
Let's look at each of the properties in turn:
@@ -168,8 +168,8 @@ would be as follows::
168
168
# Example: Setting mask value for enabling layers 1, 3 and 4
169
169
170
170
# Binary - set the bit corresponding to the layers you want to enable (1, 3, and 4) to 1, set all other bits to 0.
171
- # Note: Layer 20 is the first bit, layer 1 is the last. The mask for layers 4,3 and 1 is therefore
172
- 0b00000000000000001101
171
+ # Note: Layer 32 is the first bit, layer 1 is the last. The mask for layers 4,3 and 1 is therefore
172
+ 0b10000000_00000000_00000000_00001101
173
173
# (This can be shortened to 0b1101)
174
174
175
175
# Hexadecimal equivalent (1101 binary converted to hexadecimal)
@@ -368,7 +368,7 @@ occurred:
368
368
func _physics_process(delta):
369
369
var collision_info = move_and_collide(velocity * delta)
370
370
if collision_info:
371
- var collision_point = collision_info.position
371
+ var collision_point = collision_info.get_position()
372
372
373
373
.. code-tab :: csharp
374
374
@@ -400,7 +400,7 @@ Or to bounce off of the colliding object:
400
400
func _physics_process(delta):
401
401
var collision_info = move_and_collide(velocity * delta)
402
402
if collision_info:
403
- velocity = velocity.bounce(collision_info.normal )
403
+ velocity = velocity.bounce(collision_info.get_normal() )
404
404
405
405
.. code-tab :: csharp
406
406
0 commit comments