How can I cause a sphere to bounce infinitely without gaining or losing any energy?

I’m trying to create a sphere that bounces forever, and after each bounce, it always reaches a fixed height.

I added a physic material to a sphere. I set Dynamic and Static Friction to 0, Friction Combine to “Minimum”, Bounciness to 1, and Bounce Combine to “Maximum”. But unfortunately, the sphere gains energy after each bounce. This results in the sphere gaining height during each bounce.

I’ve searched for solution online which do not require any code. But none of them are useful. My only option is to use code. Is there a way I can cause the sphere to bounce forever, without gaining or losing energy, so that it always reaches the same height after every bounce?

Be careful to the physic material applied on the platform you bounce on, try to add a material with zero friction. The standard assets contain some physic materials, one of them is called ZeroFriction which should be what you need for your platform :
84871-zerofriction.jpg
(note the ‘Multiply’ friction combine option which will keep friction to 0 :P)

If you are on a terrain, just click on it, then you can change the physic material under the Terrain Collider option, 84870-terrain-collider.jpg

If you are on a plane, or any other 3D object, you know how to change it :wink:

The ancients say that the ideal value of bounciness for infinity bounce is something around 0.9803922