var player : Transform;
private var controller : CharacterController;
var gravity : int;
var moveSpeed : int;
var jumpHight : int;
function Start () {
controller = player.GetComponent(CharacterController);
}
function Update () {
if(Input.GetAxis("D")) {
controller.Move(Vector3.right * moveSpeed * Time.deltaTime);
}
if(Input.GetAxis("A")) {
controller.Move(Vector3.right * -moveSpeed * Time.deltaTime);
}
if(controller.isGrounded Input.GetButtonDown("Jump")) {
controller.Move(Vector3.up * jumpHight * Time.deltaTime);
}
}
The player just like, moves up very quickly and goes back down. Doesn’t look good at all. What did I do wrong?