x


How can I remove momentum/inertia?

I have a script that controls an aeroplane. Currently, when I completely turn around it keeps going backwards untill it stops and accelerates forward. This is, as you can imagine, extremely unrealistic. I have no idea how to remove momentum. Any help?

var maxTorque : float = 10.0f;
var forwardForce : float = 10.0f;

var currentTorqueHor : float = 0.0f;
var currentTorqueVer : float = 0.0f;
var currentTorqueBank : float = 0.0f;

function Update()
{
    currentTorqueHor = maxTorque * Input.GetAxis("Horizontal"); 
    currentTorqueVer = maxTorque * Input.GetAxis("Vertical");
    currentTorqueBank = maxTorque * Input.GetAxis("Bank");
    }

function FixedUpdate()
{   
    rigidbody.AddForce(transform.forward * forwardForce);
    rigidbody.AddRelativeTorque(currentTorqueVer, currentTorqueBank, -currentTorqueHor);
}
more ▼

asked Apr 10 '11 at 11:48 PM

Max 4 gravatar image

Max 4
254 60 64 71

(comments are locked)
10|3000 characters needed characters left

0 answers: sort newest
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1881
x68
x24
x1

asked: Apr 10 '11 at 11:48 PM

Seen: 1230 times

Last Updated: Apr 10 '11 at 11:48 PM