Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

KinematicCollision3D

Inherits: RefCounted < Object

Holds collision data from the movement of a PhysicsBody3D.

Description

Holds collision data from the movement of a PhysicsBody3D, usually from PhysicsBody3D.move_and_collide. When a PhysicsBody3D is moved, it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision3D object is returned.

The collision data includes the colliding object, the remaining motion, and the collision position. This data can be used to determine a custom response to the collision.

Methods

float

get_angle ( int collision_index=0, Vector3 up_direction=Vector3(0, 1, 0) ) const

Object

get_collider ( int collision_index=0 ) const

int

get_collider_id ( int collision_index=0 ) const

RID

get_collider_rid ( int collision_index=0 ) const

Object

get_collider_shape ( int collision_index=0 ) const

int

get_collider_shape_index ( int collision_index=0 ) const

Vector3

get_collider_velocity ( int collision_index=0 ) const

int

get_collision_count ( ) const

float