Skip to content

Commit

Permalink
Change misleading comment in 'Your first 3D game'
Browse files Browse the repository at this point in the history
On the collision processing code (Chapter 6 - Jumping and squashing monsters) there is a misleading comment saying that the collision.get_collider() == null has the purpose of checking for a collision with the ground.

This addresses the following open issue: godotengine#9355
  • Loading branch information
fmnjose authored May 15, 2024
1 parent 547d701 commit d3e8abd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion getting_started/first_3d_game/06.jump_and_squash.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ With this code, if no collisions occurred on a given frame, the loop won't run.
# We get one of the collisions with the player
var collision = get_slide_collision(index)

# If the collision is with ground
# If there are duplicate collisions with a mob in a single frame
# the mob will be deleted after the first collision, and a second call to
# get_collider will return null, leading to a null pointer when calling
# collision.get_collider().is_in_group("mob").
# This block of code prevents processing duplicate collisions.
if collision.get_collider() == null:
continue

Expand Down

0 comments on commit d3e8abd

Please sign in to comment.