|
Hi, I'm trying to make my plane lift off and ascend, but instead it descends. Can anyone help me? Thank you. var liftSpeed = 20.0; function FixedUpdate(){ }
(comments are locked)
|
|
If you just want it to ascend vertically, use: transform.Translate(Vector3.up * liftSpeed * Time.deltaTime); It will go up like a Sea Harrier. I've started to play around with aircraft dynamics.. I am new to all this .. I have my craft hovering and controls are more like a helicopter. here's a sample of code function FlyForward (){ I am trying to achieve stable turns. Currently my craft tends to yaw rather than bank. Is it ok to use rigidbody.AddRelativeForce as apposed to rigidbody.AddForce ??
Jun 10 '12 at 04:04 PM
Mickman
AddForce is based on world coordinates. For a spaceship or airplane, it makes more sense to use AddRelativeForce, because the ship will move in its local direction - a jet will push the airplane to its forward direction, for instance. For an airplane, the gravity is the only world related force; for a spaceship, usually there are no world based forces.
Jun 10 '12 at 09:29 PM
aldonaletto
(comments are locked)
|

That code will only make your plane move along its local forward axis.
Change your transform.forward to transform.position.y, see if that works
@FlamingHairball is right: this code only moves forward - and if your plane has a rigidbody and use gravity, it will descend.