Collision data for KinematicBody collisions.
    public class KinematicCollision : Reference

Contains collision data for KinematicBody collisions. When a KinematicBody is moved using KinematicBody.MoveAndCollide(Godot.Vector3), 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.

Inheritance Chain

Constructors

    public KinematicCollision()

Properties

    public Object Collider { get; }

The colliding body.

    public int ColliderId { get; }

The colliding body’s unique RID.

    public object ColliderMetadata { get; }

The colliding body’s metadata. See Object.

    public Object ColliderShape { get; }

The colliding body’s shape.

    public int ColliderShapeIndex { get; }

The colliding shape’s index. See CollisionObject.

    public Vector3 ColliderVelocity { get; }

The colliding object’s velocity.

    public Object LocalShape { get; }

The moving object’s colliding shape.

    public Vector3 Normal { get; }

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

    public Vector3 Position { get; }

The point of collision.

    public Vector3 Remainder { get; }

The moving object’s remaining movement vector.

    public Vector3 Travel { get; }

The distance the moving object traveled before collision.

Methods

    public Object GetCollider()

Getter for Collider

    public int GetColliderId()

Getter for ColliderId

    public object GetColliderMetadata()

Getter for ColliderMetadata

    public Object GetColliderShape()

Getter for ColliderShape

    public int GetColliderShapeIndex()

Getter for ColliderShapeIndex

    public Vector3 GetColliderVelocity()

Getter for ColliderVelocity

    public Object GetLocalShape()

Getter for LocalShape

    public Vector3 GetNormal()

Getter for Normal

    public Vector3 GetPosition()

Getter for Position

    public Vector3 GetRemainder()

Getter for Remainder

    public Vector3 GetTravel()

Getter for Travel

Tags: