I'm creating a simple driving game were the player controlled vehicle is a single box-like rigid body.
I am accelerating the vehicle with rigid.body.AddRelativeForce and I'm steering the object with rigid.body.MoveRotation.
I really need to be able to obtain the relative velocity along the vehicles local X axis (forwards and backwards) to be able to script rules and logic from, and right now all I seem able to do is get either the world velocity (rigidbody.velocity) or all-axis-combined velocity (rigidbody.velocity.magnitude) but neither of these are accurate enough for what I want to do.
Can anyone offer any hints here?
Thanks.