github_url: | hide |
---|
Inherits: :ref:`Reference<class_Reference>` < :ref:`Object<class_Object>`
Collision data for :ref:`KinematicBody<class_KinematicBody>` collisions.
Contains collision data for :ref:`KinematicBody<class_KinematicBody>` collisions. When a :ref:`KinematicBody<class_KinematicBody>` is moved using :ref:`KinematicBody.move_and_collide<class_KinematicBody_method_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.
- :ref:`Object<class_Object>` collider
Getter | get_collider() |
The colliding body.
- :ref:`int<class_int>` collider_id
Default | 0 |
Getter | get_collider_id() |
The colliding body's unique instance ID. See :ref:`Object.get_instance_id<class_Object_method_get_instance_id>`.
- :ref:`Variant<class_Variant>` collider_metadata
Getter | get_collider_metadata() |
The colliding body's metadata. See :ref:`Object<class_Object>`.
- :ref:`Object<class_Object>` collider_shape
Getter | get_collider_shape() |
The colliding body's shape.
- :ref:`int<class_int>` collider_shape_index
Default | 0 |
Getter | get_collider_shape_index() |
The colliding shape's index. See :ref:`CollisionObject<class_CollisionObject>`.
- :ref:`Vector3<class_Vector3>` collider_velocity
Default | Vector3( 0, 0, 0 ) |
Getter | get_collider_velocity() |
The colliding object's velocity.
- :ref:`Object<class_Object>` local_shape
Getter | get_local_shape() |
The moving object's colliding shape.
Default | Vector3( 0, 0, 0 ) |
Getter | get_normal() |
The colliding body's shape's normal at the point of collision.
- :ref:`Vector3<class_Vector3>` position
Default | Vector3( 0, 0, 0 ) |
Getter | get_position() |
The point of collision, in global coordinates.
- :ref:`Vector3<class_Vector3>` remainder
Default | Vector3( 0, 0, 0 ) |
Getter | get_remainder() |
The moving object's remaining movement vector.
Default | Vector3( 0, 0, 0 ) |
Getter | get_travel() |
The distance the moving object traveled before collision.