i have a tire not the wheel collider and i need to spin it based on Velocity but velocity readings show only world Space so when i turn the car its now recording sideways velocity;
When I Tried to Use InverseTransformDirection it didnt do anything so don’t say that.
Well I say use InverseTransformDirection because it’s the answer. Maybe you used the wrong transform? You should use the transform of your car object as this is the “local space” you want to consider. Note that the “car” object would be the thing that actually rotates to define what you consider “forward”.
Though your question and setup explanation is a bit vague. So does your car actually have wheel colliders? If so, the rotation of the wheels should be controlled by WheelCollider.rpm of the corresponding wheel. If you just want to know the overall speed of the car, just read the magnitude of the world space velocity.
Note that the transform you use for InverseTransformDirection should not be scaled at all. If it is scaled for some reason, either use another transform that isn’t scaled, or use
Vector3 localVelocity = Quaternion.Inverse(carTransform.rotation) * worldVelocity;