Hi. I recently got a script for an aeroplane, and I need to know how to make it bank.
var maxTorque : float = 10.0f;
var forwardForce : float = 10.0f;
var currentTorqueHor : float = 0.0f;
var currentTorqueVer : float = 0.0f;
function Update()
{
currentTorqueHor = maxTorque * Input.GetAxis("Horizontal");
currentTorqueVer = maxTorque * Input.GetAxis("Vertical");
}
function FixedUpdate()
{
rigidbody.AddForce(transform.forward * forwardForce);
rigidbody.AddRelativeTorque(currentTorqueVer, 0.0f, -currentTorqueHor);
}
This script doesn't let me bank. When I rotate a bit I have to go up to move in that direction. I've seen people do it before and it works very well. Also, I have a problem with momentum. When I change direction, it takes a while for my momentum to recede. So, if I turn the opposite direction, I will fly in backwards while slowing down until it stops, and then accelerate forward. Anyone know how to change this?