(2D) How to maintain perfect elastic collisions?

Hey all! I am trying to make circles have perfect elastic collisions with each other. Instead of having perfect elastic collisions, they slow down over time and tend to hug the border.

Here is a description of my project: multiple circular prefabs are instantiated at runtime with random velocities in random directions. There is a circular border surrounding these prefabs. All circle prefabs have Rigidbody 2D (no gravity), and Circle Collider 2D (with a physics material set to 0 friction and 1 bounciness). The circular border is just a circular Edge Collider 2D with the same physics material as the circle prefabs.

Is there anything I’m missing?

One can record the velocity before collision that can be done through raycasting(OnCollisonEnter would be of no help sine it records zero velocity).Also you have compute the normal and tangent and take dot product with initial velocity to get the velocity after collision.Follow these vidoes (OutOfBounds 94 - YouTube ) for better understanding.Soon a blog will be written on it.

Record the total initial momentum of the system. In each collision check the the total amount of momentum, and adjust as appropriate.

Unity will remain pretty good elasticity, but due to floating point precision errors and rounding errors the system will eventually break down.