My floating spaceship(Character Controller) won't move in x direction, but it does move in y direction.
And this is a script i am using:
var speed : float = 6.0;
private var moveDirection : Vector3 = Vector3.zero;
function Update() {
var controller : CharacterController = GetComponent(CharacterController);
moveDirection = Vector3(Input.GetAxis("Horizontal"),Input.GetAxis("Vertical"),0);
//Debug.Log("Horizontal");
//Debug.Log(Input.GetAxis("Horizontal"));
//Debug.Log("Vertical");
//Debug.Log(Input.GetAxis("Vertical"));
moveDirection *= speed;
//Debug.Log(moveDirection);
controller.Move(moveDirection * Time.deltaTime);
}
Also if i use the construct below it moves perfectly along the y and z axis. It seems as only x axis is the problem.
moveDirection = Vector3(0,Input.GetAxis("Vertical"),Input.GetAxis("Horizontal"));