CharacterController problem

... Scripting. I wrote a short script to move the spacship in my game and rotate around. here it is,

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

// Rotate around y - axis
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);

// Move forward / backward
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);
}

I added a character controler to my object but when I pressed play the ship didn't move fowards. The camera rotates properly but the ship only falls. how can i fix this?

Don't use a character controller for that. I don't think you can turn off gravity on a character controller. Instead, consider using a rigid body. Alternatively, put a collider underneath your ship to "run" on.

Also, hey look at this: http://www.unifycommunity.com/wiki/index.php?title=ShipControls

You don't want to use simpleMove for this. Instead, use the more complex move command, the full documentation for which can be found here. Using this, you can opt as to whether you want to use gravity or not.

However, if you're trying to make a ship (as in Asteriods), this script may do the trick:

var rotateSpeed = 360.0;
var thrustSpeed = 25.0;

function FixedUpdate() { 
   transform.Rotate (Vector3.up * (Input.GetAxis("Horizontal") * rotateSpeed * Time.deltaTime) ); 

   if (Input.GetButton("Thrust") ) { 
      rigidbody.AddRelativeForce (Vector3.forward * thrustSpeed * Time.deltaTime); 
   }
}

Put it on a gameobject with a rigidbody and no character controller. To turn off gravity, just uncheck it in the rigidbody's properties. Good luck!

the ship falls because charactercontroller has a gravity.. u can fix it for e.g. by using transform.Translate(direction.normalized * speed) or something like that