فهرست منبع

Merge pull request #9382 from fmnjose/patch-1

Change misleading comment in 'Your first 3D game'
Max Hilbrunner 8 ماه پیش
والد
کامیت
0a6c134c42
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      getting_started/first_3d_game/06.jump_and_squash.rst

+ 5 - 1
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
             # We get one of the collisions with the player
             var collision = get_slide_collision(index)
             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:
             if collision.get_collider() == null:
                 continue
                 continue