KinematicCollision

Inherits: Reference < Object KinematicBody collisions.

Description

KinematicBody collisions. When a KinematicBody is moved using KinematicBody.move_and_collide, it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision object is returned. This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response.

Properties

Methods

Property Descriptions

  • Object collider The colliding body.

  • int collider_id Object.get_instance_id.

  • Variant collider_metadata Object.

  • RID collider_rid RID used by the PhysicsServer.

  • Object collider_shape The colliding body’s shape.

  • int collider_shape_index CollisionObject.

  • Vector3 collider_velocity The colliding object’s velocity.

  • Object local_shape The moving object’s colliding shape.

  • Vector3 normal The colliding body’s shape’s normal at the point of collision.

  • Vector3 position The point of collision, in global coordinates.

  • Vector3 remainder The moving object’s remaining movement vector.

  • Vector3 travel The distance the moving object traveled before collision.

    Method Descriptions

  • float get_angle ( Vector3 up_direction=Vector3( 0, 1, 0 ) ) const up_direction, which is Vector3.UP by default. This value is always positive.