Function KinematicBody2D.getSlideCollision
Returns a KinematicCollision2D
, which contains information about a collision that occurred during the last moveAndSlide
call. Since the body can collide several times in a single call to moveAndSlide
, you must specify the index of the collision in the range 0 to (getSlideCount
- 1).
Example usage:
godot .d .reference .Ref!(godot.kinematiccollision2d.KinematicCollision2D) getSlideCollision
(
const(long) slide_idx
) nothrow @nogc;
for i in get_slide_count(): var collision = get_slide_collision(i) print("Collided with: ", collision.collider.name)