Rigidbody w/ wheelColliders and ConfigurableJoint gets stuck when attaching joint to other Rigidbody

Hi guys,

I can easily reproduce this problem, so I’m curious what it’s about.

Situation:
Vehicle A:
Rigidbody

  • 4 wheelColliders, default settings

  • brakeTorque and motorTorque set to Mathf.Epsilon

  • ConfigurableJoint

  • ConnectedAnchor set at runtime

  • Angular Motions all limited

  • Motion set to Free, but changes to locked at runtime

  • Connected Rigidbody set at runtime

  • (Collisions on or off behave the same)

Vehicle B:
Rigidbody

  • 4 wheelColliders, default settings w/ motorTorque and brakeTorque set as needed

Desired behavior:
When Vehicle A locks itself to Vehicle B, it should be towed by vehicle A.

What happens:
Vehicle A gets stuck and doesn’t move anywhere when vehicle B tries to pull it. However, when I manually move Vehicle A off the ground, after it hits the ground and gets some momentum, it seems to be towable without limitations. No more issues.
Initially placing Vehicle A above the ground doesn’t work either. It doesn’t appear to be stuck in the ground, but just locked into place as soon as its configurable joint attaches itself to Vehicle B.

Has anyone experienced the same thing or does anyone know a solution?
I tried both 2019.3.11 f1 as well as 2020.1.0b8. Both with the same results.

Thanks!

Fixed. It all had to do with the motorTorque that was set to Epsilon. The value was too low for a ‘dumb wheel’ which resulted in the rigidbody going to sleep. Setting it to something like 0.0001f did the trick. It’s a PhysX optimization thing.

And where did you set this value ??

TBH that’s an odd reason to necro a thread when the OP explicitly said in what you quoted. They said the “motorTorque”. The subject is obviously about the wheel collider.

The docs:
https://docs.unity3d.com/ScriptReference/WheelCollider-motorTorque.html