using UnityEngine; using System.Collections; public class Fly: MonoBehaviour { //The purpose of this script is to simulate Newtonian phy private float maxThrust = 10; //The maximum Thrust provided by the thruster(s) at full throttle private float rollWeight = 1; //This float and the next two only serve to adjust sensitivity private float pitchWeight = 1;//of the controls, and to allow calibration for more massive ships. private float yawWeight = 1;//Set these 3 floats to the mass of the rigidbody for sensitive controls // Update is called once per frame void FixedUpdate () { float yaw = yawWeight*Input.GetAxis("Yaw"); float roll = rollWeight*Input.GetAxis("Roll"); float pitch = pitchWeight*Input.GetAxis("Pitch"); Vector3 Rotation = new Vector3(pitch, roll, yaw); rigidbody.AddRelativeTorque(Rotation); float throttle = maxThrust *Input.GetAxis("Thrust"); rigidbody.AddRelativeForce(Vector3.down*throttle); System.Console.WriteLine("input is "+ yaw.ToString()+", "+pitch.ToString()+", "+roll.ToString()); } }