Contact:setRestitution

Edit

Sets the restitution of the Contact. Restitution makes the Colliders bounce off of each other. A restitution value of zero results in an inelastic collision response, whereas 1.0 results in an elastic collision that preserves all of the velocity. Restitution can be bigger than 1.0 to make the collision even more bouncy.

Contact:setRestitution(restitution)

Arguments

NameTypeDescription
restitutionnumber The contact restitution.

Returns

Nothing

Notes

The default restitution is the maximum restitution of either of the colliders.

Negative restitution values will be clamped to zero.

See also