KinematicBody2DGetSlideCollision Method |
Returns a KinematicCollision2D, which contains information about a collision that occurred during the last call to MoveAndSlide(Vector2, NullableVector2, Boolean, Int32, Single, Boolean) or MoveAndSlideWithSnap(Vector2, Vector2, NullableVector2, Boolean, Int32, Single, Boolean). Since the body can collide several times in a single call to MoveAndSlide(Vector2, NullableVector2, Boolean, Int32, Single, Boolean), you must specify the index of the collision in the range 0 to (GetSlideCount - 1).
Example usage:
for i in get_slide_count(): var collision = get_slide_collision(i) print("Collided with: ", collision.collider.name)
Namespace: Godot
public KinematicCollision2D GetSlideCollision( int slideIdx )
[Missing <param name="slideIdx"/> documentation for "M:Godot.KinematicBody2D.GetSlideCollision(System.Int32)"]
[Missing <returns> documentation for "M:Godot.KinematicBody2D.GetSlideCollision(System.Int32)"]