Struct KinematicCollision
Collision data for KinematicBody
collisions.
struct KinematicCollision
;
Contains collision data for KinematicBody
collisions. When a KinematicBody
is moved using KinematicBody
, 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
Name | Type | Description |
---|---|---|
collider [get]
|
GodotObject | The colliding body. |
colliderId [get]
|
long | The colliding body's unique instance ID. See GodotObject .
|
colliderMetadata [get]
|
Variant | The colliding body's metadata. See GodotObject .
|
colliderShape [get]
|
GodotObject | The colliding body's shape. |
colliderShapeIndex [get]
|
long | The colliding shape's index. See CollisionObject .
|
colliderVelocity [get]
|
Vector3 | The colliding object's velocity. |
localShape [get]
|
GodotObject | The moving object's colliding shape. |
normal [get]
|
Vector3 | The colliding body's shape's normal at the point of collision. |
position [get]
|
Vector3 | The point of collision, in global coordinates. |
remainder [get]
|
Vector3 | The moving object's remaining movement vector. |
travel [get]
|
Vector3 | The distance the moving object traveled before collision. |
Methods
Name | Description |
---|---|
getCollider
|
|
getColliderId
|
|
getColliderMetadata
|
|
getColliderShape
|
|
getColliderShapeIndex
|
|
getColliderVelocity
|
|
getLocalShape
|
|
getNormal
|
|
getPosition
|
|
getRemainder
|
|
getTravel
|