I have a steering input that I want to make non-linear, so with more lock the turn rate increases.
It is based on an xBox controller, currently this is on a input.getaxis which is multiplied by a speed constant and then clamped between -1 and 1.
Could I increase the speed for a certain angle or can I map it to a curve?
Thank you
I have found that the easiest way to work with curves with native Unity is the AnimationCurve type.
public AnimationCurve myAnimationCurve;
This may not always satisfy every need, but it sounds appropriate for your stated requirement. Design the curve in the inspector, or optionally build or edit the curve handles at runtime with the API.
The argument used to evaluate your current position on the curve expects a normalized value (zero-to-one range). This can be derived from whatever variable you like, such as the normalized percentage of “lock” your vehicle is experiencing.
// assumes lock is positive and minimum lock is zero
float lockPercentage = myCurrentLockValue / maximumLockValue;
float steeringSensitivity = myAnimationCurve.Evaluate( lockPercentage );
Hello
I added the following code:
SteerAngle = Input.GetAxis("Wheel") * 0.08f;
SteerAngle = Mathf.Clamp(SteerAngle, -1.0f, 1.0f);
//Code added by KL as a test
float SteeringSensitivity = SteeringCurve.Evaluate(SteerAngle);
As well as the public AnimationCurve SteeringCurve
I am debugging in unity now but it still does not work. I created the attached curve.
Any ideas much appreciated 
Thank you
,Hi
I added the
public AnimationCurve SteeringCurve;
and the following code
SteerAngle = Input.GetAxis("Wheel") * 0.08f;
SteerAngle= Mathf.Clamp(SteerAngleAngle, -1.0f, 1.0f);
//Code added by KL as a test
float SteeringSensitivity = SteeringCurve.Evaluate(SteerAngle);
And also the attached curve. I’m currently debugging in Unity but the xBox controller input for steering no longer seems to work, have I missed something?
Thank you