Struct KinematicCollision

Collision data for KinematicBody collisions.

struct KinematicCollision ;

Contains collision data for KinematicBody collisions. When a KinematicBody is moved using KinematicBody.moveAndCollide, 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

NameTypeDescription
collider[get] GodotObjectThe colliding body.
colliderId[get] longThe colliding body's unique instance ID. See GodotObject.getInstanceId.
colliderMetadata[get] VariantThe colliding body's metadata. See GodotObject.
colliderShape[get] GodotObjectThe colliding body's shape.
colliderShapeIndex[get] longThe colliding shape's index. See CollisionObject.
colliderVelocity[get] Vector3The colliding object's velocity.
localShape[get] GodotObjectThe moving object's colliding shape.
normal[get] Vector3The colliding body's shape's normal at the point of collision.
position[get] Vector3The point of collision, in global coordinates.
remainder[get] Vector3The moving object's remaining movement vector.
travel[get] Vector3The distance the moving object traveled before collision.

Methods

NameDescription
getCollider
getColliderId
getColliderMetadata
getColliderShape
getColliderShapeIndex
getColliderVelocity
getLocalShape
getNormal
getPosition
getRemainder
getTravel