KinematicCollision
Collision data for collisions.
Contains collision data for KinematicBody collisions. When a 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.
- collider
Getter | get_collider() |
The colliding body.
Default | 0 |
Getter | get_collider_id() |
- Variant collider_metadata
Getter | get_collider_metadata() |
The colliding body’s metadata. See .
- Object collider_shape
The colliding body’s shape.
- collider_shape_index
Default | |
Getter | get_collider_shape_index() |
The colliding shape’s index. See CollisionObject.
- collider_velocity
Default | Vector3( 0, 0, 0 ) |
Getter | get_collider_velocity() |
The colliding object’s velocity.
Getter | get_local_shape() |
- Vector3 normal
The colliding body’s shape’s normal at the point of collision.
- position
Default | Vector3( 0, 0, 0 ) |
Getter | get_position() |
The point of collision, in global coordinates.
- Vector3 remainder
Default | |
Getter | get_remainder() |
The moving object’s remaining movement vector.
- travel
Default | Vector3( 0, 0, 0 ) |
Getter | get_travel() |
The distance the moving object traveled before collision.