From 426c83b39a667b929ea4dffc458f91bfae3c4dce Mon Sep 17 00:00:00 2001 From: Cris Higham <62340127+CrisHigham@users.noreply.github.com> Date: Thu, 26 Oct 2023 07:39:23 +0200 Subject: [PATCH] Update 06.jump_and_squash.rst Spacing on for loop, only 3 spaces instead of 4. This results in tab allocations in the editor failing when using copy and paste from the docs into the code editor. --- .../first_3d_game/06.jump_and_squash.rst | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) 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 fc506847962..4f703b7acd8 100644 --- a/getting_started/first_3d_game/06.jump_and_squash.rst +++ b/getting_started/first_3d_game/06.jump_and_squash.rst @@ -236,25 +236,25 @@ With this code, if no collisions occurred on a given frame, the loop won't run. .. code-tab:: gdscript GDScript func _physics_process(delta): - #... - - # Iterate through all collisions that occurred this frame - for index in range(get_slide_collision_count()): - # We get one of the collisions with the player - var collision = get_slide_collision(index) - - # If the collision is with ground - if collision.get_collider() == null: - continue - - # If the collider is with a mob - if collision.get_collider().is_in_group("mob"): - var mob = collision.get_collider() - # we check that we are hitting it from above. - if Vector3.UP.dot(collision.get_normal()) > 0.1: - # If so, we squash it and bounce. - mob.squash() - target_velocity.y = bounce_impulse + #... + + # Iterate through all collisions that occurred this frame + for index in range(get_slide_collision_count()): + # We get one of the collisions with the player + var collision = get_slide_collision(index) + + # If the collision is with ground + if collision.get_collider() == null: + continue + + # If the collider is with a mob + if collision.get_collider().is_in_group("mob"): + var mob = collision.get_collider() + # we check that we are hitting it from above. + if Vector3.UP.dot(collision.get_normal()) > 0.1: + # If so, we squash it and bounce. + mob.squash() + target_velocity.y = bounce_impulse .. code-tab:: csharp