The vehicle is supposed to inverse bank during turns. This part works, but for realism, I want it to bank less when the vehicle is moving faster. I am not that familiar with Unity scripting overall, and I am not quite sure how to do this. I am including the code pertaining to this function below. If any of you guys could suggest what I need to do, to create this behavior, I would be in your debt.
var forwardforce = Input.GetAxis (“Vertical”);
var shiprotation = Input.GetAxis (“Horizontal”);
var reverseforce = Input.GetAxis (“Vertical”);
// Calculate the forward motion
forwardforce = enginepower * forwardforce;
reverseforce = reversepower * reverseforce;
// This prevents the ship from moving backwards too quickly
if (forwardforce <= reversepower) forwardforce = reverseforce;
rigidbody.AddRelativeForce (0,0,forwardforce);
// Calculate the rotational forces;
shiprotation = turnrate * shiprotation;
rigidbody.AddTorque (0, shiprotation, 0);
var shipbanking = shiprotation *-1;
playership.localEulerAngles = Vector3 (0,0, shipbanking);