Skip to content

PhysicsCastMotionResult2D

Inherits: RefCounted < Object

Stores the result of a shape motion cast query.

This class contains the safe and unsafe fractions computed by PhysicsDirectSpaceState2D.cast_motion_into().

Note: For optimal performance results, it is recommended to create this object in advance, store it, and reuse it for every subsequent query.

Type Name Default
float safe_fraction 1.0
float unsafe_fraction 1.0

safe_fraction

float safe_fraction = 1.0

The maximum fraction of the motion that can be made without a collision.

unsafe_fraction

float unsafe_fraction = 1.0

The minimum fraction of the distance that must be moved for a collision.