Reduce banking with speed

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);

How about when you compute shipbanking you multiply by a factor that you compute using the magnitude of the the velocity of the rigidbody?

Ok, but my question is, how do I do this? I know what I want to do, but my efforts were not giving me good results.

You can do something like

// Appears in Inspector for tweaking. Higher the value the more speed dampens banking.
var bankFactor = 0.07;
...
bankModifier = 1.0 - (rigidbody.velocity.magnitude * bankFactor);
var shipbanking = shiprotation *-1 * bankModifier; 
...

Ok, thank you, that did exactly what I needed it to do. I wouldn’t have thought of that, at least not very quickly.