# Plane increase speed

OK, I have a plane script that works just fine. I need it to slowly increase speed just like a real plane. The way it is written just shoots it off.

``````var moveSpeed= 60.0;

var turnSpeed = 40.0;

var Forward : KeyCode;

var Backward : KeyCode;

var Left : KeyCode;

var Right : KeyCode;

function Update () {

if(Input.GetKey(Forward))

{

transform.eulerAngles.z += - turnSpeed * Time.deltaTime;

}

if(Input.GetKey(Backward))

{

transform.eulerAngles.z += turnSpeed * Time.deltaTime;

}

if(Input.GetKey(Left))

{

transform.eulerAngles.x +=  turnSpeed * Time.deltaTime;

}

if(Input.GetKey(Right))

{

transform.eulerAngles.x += - turnSpeed * Time.deltaTime;

}

if(Input.GetButton("Jump")){

transform.position += transform.right * - moveSpeed * Time.deltaTime;

}

}
``````

Any help would be appreciated.

``````                                Thanks, Tim
``````

Hello, did you see there is a code formatting button at the top of the post page

``````if ( Input.GetKey("mouse 1") )
{constantForce.relativeForce = 15000 * Vector3.forward
;}
``````

this simulates thrusters on a plane by adding a constant force forwards

Here is the complete code for my plane:

``````var speed = 15.0;
var rotspd = 10.0 ;
var bullitPrefab : Transform;

function Update ()
{

if ( Input.GetKey("mouse 1") )
{constantForce.relativeForce = 15000 * Vector3.forward
;}
else
{constantForce.relativeForce = Vector3.zero;}
if(Input.GetButton("forwards"))
{
transform.eulerAngles.x += rotspd * Time.deltaTime * 7;
}

if(Input.GetButton("backwards"))
{
transform.eulerAngles.x += -rotspd * Time.deltaTime * 7;
}

if(Input.GetButton("left"))
{
transform.eulerAngles.y += -rotspd * Time.deltaTime * 7;
}

if(Input.GetButton("right"))
{
transform.eulerAngles.y += rotspd * Time.deltaTime * 7;
}

if(Input.GetButton("Fire1"))
{
var bullit = Instantiate(bullitPrefab, transform.Find("spawnPoint").transform.position, Quaternion.identity);
}

}

/*var speed = 3.0;

var rotateSpeed = 32.0;

var bullitPrefab : Transform;

function Update ()
{
var controller : CharacterController=GetComponent(CharacterController);

//Rot
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);

//fwd bck
var forward = transform.TransformDirection(Vector3(0,0,1));
var curSpeed = speed * Input.GetAxis ("Vertical");

controller.SimpleMove(forward * curSpeed);

if(Input.GetButtonDown("Fire1"))
{
var bullit = Instantiate(bullitPrefab, transform.Find("spawnPoint").transform.position, Quaternion.identity);