Hi , i am making a ball game but the jump script makes the ball falls very fast this is the script
var jumpSpeed = 8.0;
var gravity = 20.0;
private var roling = 0.00;
private var grounded : boolean = false;
private var jumping =false;
private var moveDirection = Vector3.zero;
var MSP : GUITexture;
var Monster : Transform;
function FixedUpdate() {
if(Input.GetButtonDown("Launch"))
{
if(Ball.Launch)
{
if(TBallMonsterTransform.monster)
{
moveDirection.y = jumpSpeed;
MSP.guiTexture.pixelInset.width -= 3;
jumping =true;
}
}
}
if(jumping)
{
if(roling < 360)
{
Monster.transform.Rotate(0 , 10, 0);
roling += 10;
}
}
if(roling > 359)
{
jumping = false;
roling = 0;
}
moveDirection.y -= gravity * Time.deltaTime;
var controller : CharacterController = GetComponent(CharacterController);
var flags = controller.Move(moveDirection * Time.deltaTime);
grounded = (flags & CollisionFlags.CollidedBelow) != 0;
}
@script RequireComponent(CharacterController)