- Home /
Car Steering Relative to Car Speed
I am trying to make a racing game, and it's going well so far, but I just encountered a (rather large) problem. I would like the wheels to steer at a different maximum angle relative to the car's speed. For example: if the car is going below 10 mph, the max steering angle would be 20, if it is going above 20, it would be 8, if it is going above 60, it would be 3. I am using the J controlled car script (from JCar). If anyone would modify this script (or show me how to), I would really appreciate it. I do not know very much about in the language JCar is coded in, or how to code in it, but would not be opposed to coding if someone would show me how to. Thanks in advance!
-kmb
Answer by Symyon · Jan 28, 2013 at 01:48 PM
So basically you want from an input (speed) get an output (steering angle coeficient) and that the output is inverse proportional to the input.
So for x = speed, what is f(x) = steering_angle_ coefficient. The answer is: f(x) = a 1/x*, where a can be any constant for which the steering seems OK. This f(x) then can be multiplied with the standard steering you get.
Example: lets say the a we picked is 30. For speed of 1 the steering angle coefficient is: f(1) = 30 For speed of 10 the steering angle coefficient is: f(10) = 3
About the JCar, I'm not familiar with, but it shouldn't be hard to multiply the final value of the steering angle with the coefficient shown above.
Answer by WindyBut · Jan 28, 2013 at 01:48 PM
I wish I could help you more with this but I am only just learn myself. But if you go here:- http://www.youtube.com/watch?v=kAEpLX3rfms&list=UU3H-n_qgipIYB5bJKjlKUIg∈dex=9 It may go some way to help you out.
Your answer
Follow this Question
Related Questions
Reduce steerangle at high speeds 1 Answer
How to make a steering wheel that rotates when wheels do? 0 Answers
Car exhaust Flame in unity 1 Answer
Car Question 2 Answers
CAR ROTATING HELP 2 Answers