I can reproduce the problem reliably.
- Create three Physics Materials with friction set to .1, .3 and .6 respectively
- Create three spheres, add rigid bodies to each one
- Add Physics Materials, .1, .3. and .6 to the Colliders of each three spheres respectively.
- Create terrain and a Physics Material for it, set it to .5.
I took a video:
The sphere with a Physics Material of .1 edges barely ahead but then all three stay the same distance apart which shouldn’t happen because the friction on each one is different. They should all slow down and stop at different rates. I can even bump up the friction to 1 and the balls will still role forever.
It’s like there is no friction at all yet clearly the Physics Materials are correctly setting it. This looks like a bug to me.
Here’s the code to the FrictionTest
class I placed on each sphere:
public class FrictionTest : MonoBehaviour
{
public bool StartTest = false;
public static bool StaticStartTest = false;
public float Force = 1000;
public Camera FollowCamera;
public float smoothTime = 0.08F;
private Vector3 velocity = Vector3.zero;
private void Update()
{
//Crude workaround so setting StartTest on any one sphere will trigger all spheres
if (StartTest == true)
{
StartTest = false;
StaticStartTest = true;
}
if (StaticStaticStart == true)
{
StaticStartTest = false;
StartTest();
}
if (FollowCamera != null)
{
FollowCamera.transform.LookAt(this.transform.position);
Vector3 desiredPosition = this.transform.position + new Vector3(1, 1, 3);
Camera.main.transform.position = Vector3.SmoothDamp(Camera.main.transform.position, desiredPosition, ref velocity, smoothTime);
}
}
public void StartTest()
{
Rigidbody rb = this.transform.GetComponent<Rigidbody>();
rb.AddForce(new Vector3(0, 0, Force), ForceMode.Acceleration);
}
}