In my game I have a cube that can move left and right, and jump as well. When you jump, the player arcs perfectly and falls at a very comfortable speed. But if you were to be on top of an obstacle (Example: a cube), and then moved off the edge of it without jumping, you fall straight down to the ground. You fall a lot faster then if you were to jump. Why is that? I’m using a character controller, and here is the movement code in case it is needed.
var controller : CharacterController = GetComponent(CharacterController);
moveDirection = Vector3(Input.GetAxis("Horizontal"), 0,0);
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= speed;
if (controller.isGrounded) {
if (Input.GetButton ("Jump")) {
moveDirection.y = jumpSpeed;
vertVel = jumpSpeed;
}
}
// Apply gravity
vertVel -= gravity * Time.deltaTime; // apply gravity to the vertical velocity
moveDirection.y = vertVel; // combine move direction with vertical velocity
// Move the controller
controller.Move(moveDirection * Time.deltaTime);