Looking for predefined PhysicsMaterial values.

Do we have a library/info for friction and bounciness for different physics materials.
For example body(live being), wood, ground, rock, metal etc.

There are few simple answers to this:
Friction - Real world coefficient of friction is determined by both the materials in contact and the condition of the surface. It is not possible to have a magic number for separate materials that is then combined in some equation to produce a single value. This is also particularly problematic for contacts where significant indentation occurs and further movement then requires material to be ploughed out of the way (think about sitting on a soft seat cushion and then trying to slide forward). Then of course there is the point when it stops being friction and becomes mechanical interaction (rough surfaces, penetration of surface).

Very generically I would suggest ball park numbers of
metal to metal: 0.2
rubber to metal: 0.7
rubber to concrete: 0.9
skin to metal: 0.6
These numbers can vary considerably depending exact material, temperature and lubrication.

If you don’t have too many materials and you select wisely you can get away with the physics material option, use (Edit: Average). Ice will mess you about because it doesn’t care about the other materials so you will need use lowest…

Bounciness is more officially known as

Unfortunately that has some problems - the general awkwardness / incompressibility and hysteresis in rubbers (also stress limits for polymers). The stress value is dependent upon the area loaded, so quickly gets beyond the scope of Unity / PhysX. Basically you will just have to asses objects and put in something sensible looking.

2 Likes

Do you know this values from experience ?

Can you do friction on pairs of different materials in unity ? I have not heard about this.

Values from experience yes (not Unity), but you will find plenty of data online. Some are quite well defined, e.g. metal to metal, but you will see even these values can vary a lot depending on finish and lubrication.

You can make multiple physics materials with different characteristics and assign them to colliders / terrain. There is a selector for Friction Combine that defines how they work when one material collides with another: Unity - Manual: Physic Material asset reference I have not tested any of this in Unity, so I would suggest setting up a test (e.g. lock the rotations of an rb with a sphere collider and push it on a surface). I say sphere collider as you do not want the edges of a box catching at random.

yes but you cannot create pairs like collision layers.
So you basically cannot do such a combinations:
rubber to metal: 0.7
rubber to concrete: 0.9

No you don’t have that much flexibility but you can choose which materials you want to average, so you could get close to the numbers you want with

rubber 1.0 average
metal 0.3 average
concrete 0.8 average

giving you rubber to metal 0.65 and rubber to concrete 0.9

and still capture outliers like
MagicLowSlip 1.0 Maximum
SuperSlippy 0.05 Minimum

Alternatively, you could add a script to all your colliders to dynamically create a new physics material based on a lookup of the material listed in each script. I believe there may be some issues with getting the material updated for the current collision. I think this can be resolved by dynamically creating a whole new material, but may also require this rigidbody to sleep + wake. You would have to experiment.

For me the first option looks close enough for general use, but I do not know your use case.

Before trying to increase accuracy I would be more worried about the quote in the documentation I linked to
“In particular, contact surfaces which are larger than a single point (such as two boxes resting on each other) will be calculated as having two contact points, and will have friction forces twice as big as they would in real world physics.”

A key aspect of real friction coefficients is that they are independent of area. You would have to test your use case to see how much of an issue that is for you.

2 Likes