Skip to content

Commit 44aefae

Browse files
authored
Merge pull request #655 from Calinou/bullet-shower-no-check-collision-with-other-bullets
Don't check bullet collision with other bullets in the Bullet shower demo
2 parents 1916f87 + 7a7af4c commit 44aefae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

2d/bullet_shower/bullets.gd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ func _ready():
3838

3939
Physics2DServer.body_set_space(bullet.body, get_world_2d().get_space())
4040
Physics2DServer.body_add_shape(bullet.body, shape)
41+
# Don't make bullets check collision with other bullets to improve performance.
42+
# Their collision mask is still configured to the default value, which allows
43+
# bullets to detect collisions with the player.
44+
Physics2DServer.body_set_collision_layer(bullet.body, 0)
4145

4246
# Place bullets randomly on the viewport and move bullets outside the
4347
# play area so that they fade in nicely.

0 commit comments

Comments
 (0)