# Conservation of energy of a bouncy ball in Unity3d

My problem is that in the project I have a ball with a physicMaterial where:

• Dynamic Friction and Static Friction both are 0
• Bounciness = 1
• Friction Combine is set to Multiply
• Bounce Combine is set to Maximum

This ball has a rigid body attached in which:

• mass = 1
• drag and angular drag both are 0
• useGravity = true

There are some cubes which create a boundary for the ball to bounce inside. The ball bounces in a closed boundary. The problem is overtime its top velocity keeps on increasing and after sometime it gets out of the boundary.

I want the velocity of this ball to NOT exceed a provided maxVelocity. Here i am sharing my project through google drive bounceProblem.unitypackage

• Presumably you considered caching the kinetic energy of the ball on start, and using a script to periodically adjust its velocity to not exceed that initial energy? – DMGregory Oct 1 '19 at 10:15