Hello i have a script to move the player its a ball here it is :
Vector3 movement = (Input.GetAxis("Horizontal") * -Vector3.left * movementSpeed) + (Input.GetAxis("Vertical") * Vector3.forward *movementSpeed);
rigidbody.AddForce(movement, ForceMode.Force);
and to make it jump i use this script :
if (Input.GetKeyUp("space"))
{
rigidbody.AddRelativeForce(transform.up * jumpForce, ForceMode.Impulse);
}
whats wrong with it because when i press space when its not moving it jump’s normaly but when i move and press space it doesnt jump just launches the player at the direction im moving any ideas?