From d3e8abd7101a9360c6f2e4f4c6f4716371efeedb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20Jos=C3=A9?= <52170617+fmnjose@users.noreply.github.com> Date: Wed, 15 May 2024 23:15:51 +0100 Subject: [PATCH] Change misleading comment in 'Your first 3D game' 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: https://github.com/godotengine/godot-docs/issues/9355 --- getting_started/first_3d_game/06.jump_and_squash.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/getting_started/first_3d_game/06.jump_and_squash.rst b/getting_started/first_3d_game/06.jump_and_squash.rst index 1e22476e8ee..0ffd6377d87 100644 --- a/getting_started/first_3d_game/06.jump_and_squash.rst +++ b/getting_started/first_3d_game/06.jump_and_squash.rst @@ -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