I have two objects with a Physics Material 2D, one dynamic, one static.
I can set the material on the static object to one with a bounce higher than the dynamic object and the dynamic object will bounce off it calculating with the static object. However, if the static bounce is lower than the dynamic bounce, it uses the dynamic object to calculate the bounce. This is problematic because i want to have the dynamic object hit the static object with 0 bounce on it’s material and… not bounce.
Is there a way to always prioritise this other object’s values, without removing the physics material of the dynamic object?
Unity uses default Box2D implementation:
https://github.com/erincatto/Box2D/blob/master/Box2D/Dynamics/Contacts/b2Contact.h#L35
Friction is combined as "Multiply", and bounce is combined as "Maximum". The justification is stated in the code comments:
/// Friction mixing law. The idea is to allow either fixture to drive the friction to zero.
/// For example, anything slides on ice.
/// Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface.
/// For example, a superball bounces on anything.
I guess you can’t have control over that.
Either discard the idea, use 3D Physics, get Unity source code or integrate your own physics engine (Box2D is open source, you could perhaps just modify the bounciness part and make Component wrappers for everything).