← Documentation Home

SetBodyRestitution

Category: 2D Game Physics (Pro)

Back to System Functions


Signature

SetBodyRestitution(body As Integer, restitution As Double)

Returns

Void

Description

Sets collision bounciness from 0 through 1.

Performance and behavior

Zero removes bounce; one preserves normal collision speed. Values are clamped to the valid range.

Pro feature: compiling code that uses this function requires a license with the GamePhysics feature enabled.

Example

SetBodyRestitution ball, 0.85