Hey,
I am currently trying to make a Semi Realistic WheelCollider from scratch… I have to calculate the distance the wheel traveled. But this is not so easy because if I eg. slide down a hill (sideways) the wheels should not move… So i have to calculate the angle between the motion and the facing direction… My approach was :

var angle=Vector3.Angle(Car.rigidbody.GetPointVelocity(hit.point),Wheel.transform.forward);
distance=(Car.rigidbody.GetPointVelocity(hit.point).magnitude*Time.deltaTime)*Mathf.Abs(Mathf.Cos(angle));

But this is not working correctly, the wheels are spinning in a strange way and are also rotating too slow… I have been trying to figure this out for 2 hours now and I dont get “forward”, I hope you can help me…

Wheel.forward is the blue +z arrow coming out of the wheel. Unity thinks x is sideways, y is up and z is forward.

The obvious problem with wheel.forward is that the wheel spins, so its forward could be down, up or backwards. Car.forward would be more consistent (or do the wheels also rotate to “steer”? You might want “flat” angle (if you go straight, and down a hill, the angle should be 0, but the down-ness will be part of the angle.) So:

I know this is old but, it’s new to me. In my space game I have physics based movement (AddRelativeForce), but I also wanted to cap the speed. I did this by creating a ratio of the max speed verses the current speed and applying it to the thrust. The issue with this was that if i turned, it didn’t properly calculate the amount of thrust to allow in the new direction based on the current speed. I fixed this using a ratio built from the angle between the rigidbody direction and the transform facing direction and adding it to the speed ratio. That came out more complicated than I wanted, so here is the code:
class variables

The answer to the question asked is here in this section. rotAngle = Vector3.Angle (this.transform.forward, _cacheRigidbody.velocity). But I posted all of this figuring that everyone was probably trying to solve the same, physics based space movement problem.
in my Update()

It works for me… ok. Rhere is this weird thing where the speed picks up a little unexpectedly when I turn. But I think it’s good enough for now. I hope this helps someone. BTW the rigidbody mass was set to 10000, drag = .05 and angular drag = 1. It’s for a slow moving capitol ship.