This code works but only when the rigidbody’s in the air.
#pragma strict
var MovementSpeed : float;
var JumpHeight : float;
private var MovementVer : int;
private var MovementHor : int;
function Update() {
MovementVer = Input.GetAxis("Vertical") * MovementSpeed * Time.deltaTime;
MovementHor = Input.GetAxis("Horizontal") * MovementSpeed * Time.deltaTime;
rigidbody.AddForce(MovementHor, 0, MovementVer);
}