BallBounce

Overview

BallBounce is a data type that holds the state of a ball when it collides (bounces) with a surface. It provides information necessary for analyzing bounce events, such as the direction/speed/spin and angular velocity just before collision, the time of collision, the changes in direction/speed/spin after collision, and the collision point/normal. It is used for displaying replays, tuning physics parameters, and debugging collision responses.

Constructors

Properties

AngularVelocity

Vector3

The angular velocity vector just before the collision (rad/s). The direction is the axis of rotation, and the magnitude is the angular speed.

Code Samples

local bounce = bounce
print("Incoming ang vel:", bounce.AngularVelocity)

BouncedAngularVelocity

Vector3

The angular velocity vector after the collision (rad/s).

Code Samples

BouncedDirection

Vector3

The unit vector of the movement direction after the collision.

Code Samples

BouncedPosition

Vector3

The position of the collision point.

Code Samples

BouncedSpeed

number

The speed magnitude after the collision (cm/s).

Code Samples

BouncedSpin

number

The spin after the collision (angular velocity magnitude, rad/s).

Code Samples

BouncedTime

number

The time when the bounce occurred (seconds). This is the time value on the simulation timeline.

Code Samples

CFrame

CFrame

The ball's posture based on the collision point (based on HitPosition + HitRotation). Includes both position and rotation.

Code Samples

Direction

Vector3

The unit vector of the movement direction just before the collision.

Code Samples

ImpactNormal

Vector3

The normal vector of the collision surface (perpendicular to the surface).

Code Samples

ImpactPoint

Vector3

The world coordinates of the collision contact point.

Code Samples

IsSliding

boolean

Indicates whether the ball is sliding along the surface upon collision.

Code Samples

Speed

number

The speed magnitude just before the collision (cm/s).

Code Samples

Spin

number

The spin just before the collision (angular velocity magnitude, rad/s).

Code Samples

StartPos

Vector3

The start position of the bounce simulation segment.

Code Samples

Methods

Events

See also

SimulationBallchevron-right

Last updated