- Home /
how to get car speed ???
Hello I have car with move controller and i want to get the speed of it...
i use this method :
carSpeed = (2*Mathf.PI*(FrontLeftWheel.radius*100)*FrontLeftWheel.rpm/100)*60/1000;
also i use this :
carSpeed = (2*Mathf.PI*FrontLeftWheel.radius*FrontLeftWheel.rpm/100)*60/1000;
carSpeed = ???km/hour
But i think that wrong,because car Speed retch very high number or very low.
car Wheel radius is = 0.45
Multiplied by 100 to convert from meter to cm
Answer by hirenkacha · Mar 21, 2013 at 09:59 AM
For a car, speed in km/hr is
Speed=rigidbody.velocity.magnitude*3.6;
thx very much... my $$anonymous$$d goes very far and the solution very simple. is work very good but without *3.6 Speed=rigidbody.velocity.magnitude; thx again.
You would have to write ""3.6f"" for it to work properly
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Problem with time !! help me 1 Answer
Calculating speed of rigidbody? 1 Answer
Build Problem and Collide Problem 0 Answers