Download

Make a ball bounce endlessly around the level

I have a ball that bounces around on the XZ plane, colliding with box colliders at the bounds. While this technically works, the ball does slow down and eventually gets stuck moving along only one of the two axis.

The ball and the boundary objects have a physics material that has friction at 0 and restitution at 1, I set the drag for all objects to 0, I honestly cannot figure out what the cause is. Any ideas?

You may do it two ways:
play with physics material and add a bit of energy after each bounce, but this is extremely hard to tune and depends on framerate,

Or you can make on hit event in the ball.
Then check bouncing velocity, if velocity is less than some value add tiny impulse along velocity vector,

… Nawrot may be right… but I thought that setting Restitution = 1 (or is it 0, one or the other) on the Physics Material… kept the full incoming velocity and allowed a ball to bounce forever