@@ -236,25 +236,25 @@ With this code, if no collisions occurred on a given frame, the loop won't run.
236236 .. code-tab :: gdscript GDScript
237237
238238 func _physics_process(delta):
239- #...
240-
241- # Iterate through all collisions that occurred this frame
242- for index in range(get_slide_collision_count()):
243- # We get one of the collisions with the player
244- var collision = get_slide_collision(index)
245-
246- # If the collision is with ground
247- if collision.get_collider() == null:
248- continue
249-
250- # If the collider is with a mob
251- if collision.get_collider().is_in_group("mob"):
252- var mob = collision.get_collider()
253- # we check that we are hitting it from above.
254- if Vector3.UP.dot(collision.get_normal()) > 0.1:
255- # If so, we squash it and bounce.
256- mob.squash()
257- target_velocity.y = bounce_impulse
239+ #...
240+
241+ # Iterate through all collisions that occurred this frame
242+ for index in range(get_slide_collision_count()):
243+ # We get one of the collisions with the player
244+ var collision = get_slide_collision(index)
245+
246+ # If the collision is with ground
247+ if collision.get_collider() == null:
248+ continue
249+
250+ # If the collider is with a mob
251+ if collision.get_collider().is_in_group("mob"):
252+ var mob = collision.get_collider()
253+ # we check that we are hitting it from above.
254+ if Vector3.UP.dot(collision.get_normal()) > 0.1:
255+ # If so, we squash it and bounce.
256+ mob.squash()
257+ target_velocity.y = bounce_impulse
258258
259259 .. code-tab :: csharp
260260
0 commit comments