# 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

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.

I wish I could help you more with this but I am only just learn myself. But if you go here:- #7 How to make a Car game - Unity 3D Tutorial - Steer Handling - YouTube