> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/datatype/ballbounce.md).

# 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 the collision, the time of the collision, the changes in direction/speed/spin after the 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. The direction is the axis of rotation, and the magnitude is the angular speed.

#### Code Samples

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

### BouncedAngularVelocity

`Vector3`

The angular velocity vector after the collision.

#### Code Samples

```lua
local bounce = bounce
print("Outgoing ang vel:", bounce.BouncedAngularVelocity)
```

### BouncedDirection

`Vector3`

The unit vector of the movement direction after the collision.

#### Code Samples

```lua
local bounce = bounce
print("Outgoing dir:", bounce.BouncedDirection)
```

### BouncedPosition

`Vector3`

The position of the collision point.

#### Code Samples

```lua
local bounce = bounce
print("Hit position:", bounce.BouncedPosition)
```

### BouncedRotation

`Vector3`

{description slot}

#### Code Samples

### BouncedSpeed

`number`

The speed after the collision.

#### Code Samples

```lua
local bounce = bounce
print("Outgoing speed :", bounce.BouncedSpeed)
```

### BouncedSpin

`number`

The spin after the collision.

#### Code Samples

```lua
local bounce = bounce
print("Outgoing spin :", bounce.BouncedSpin)
```

### BouncedTime

`number`

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

#### Code Samples

```lua
local bounce = bounce
print("Bounce time (s):", bounce.BouncedTime)
```

### CFrame

`CFrame`

The ball's posture based on the collision point (based on `BouncedPosition + BouncedRotation`). Includes both position and rotation.

#### Code Samples

```lua
local bounce = bounce -- BallBounce received from the simulator
print("Bounce CFrame:", bounce.CFrame)
```

### Direction

`Vector3`

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

#### Code Samples

```lua
local bounce = bounce
print("Incoming dir:", bounce.Direction)
```

### ImpactNormal

`Vector3`

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

#### Code Samples

```lua
local bounce = bounce
print("Impact normal:", bounce.ImpactNormal)
```

### ImpactPoint

`Vector3`

The world coordinates of the collision contact point.

#### Code Samples

```lua
local bounce = bounce
print("Impact point:", bounce.ImpactPoint)
```

### IsBouncedHit

`boolean`

Indicates whether this collision was an actual bounce (reflection). It is `false` for sliding collisions (when `IsSlidingHit` is `true`).

#### Code Samples

```lua
local bounce = bounce
if bounce.IsBouncedHit then
    print("This is a real bounce")
end
```

### IsSlidingHit

`boolean`

Indicates whether the ball was sliding along the surface at the time of the collision (i.e., whether it was a sliding hit). It is `false` for actual bounces (when `IsBouncedHit` is `true`).

#### Code Samples

```lua
local bounce = bounce
if bounce.IsSlidingHit then
    print("This is a sliding hit")
end
```

### SnapshotIndex

`number`

{description slot}

#### Code Samples

### Speed

`number`

The speed just before the collision.

#### Code Samples

```lua
local bounce = bounce
print("Incoming speed :", bounce.Speed)
```

### SpinSpeed

`number`

The spin just before the collision (angular velocity magnitude).

#### Code Samples

```lua
local bounce = bounce
print("Incoming spin :", bounce.SpinSpeed)
```

### StartPos

`Vector3`

The start position of the bounce simulation segment.

#### Code Samples

```lua
local bounce = bounce
print("Start pos:", bounce.StartPos)
```

## Methods

## Events

## See also

{% content-ref url="/pages/ZaoG57umzS7C4yIBXybF" %}
[SimulationBall](/development/api-reference/classes/simulationball.md)
{% endcontent-ref %}
