How do I make a rigidbody move on command (ie A Player Character)?

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);
	

	}

The fix is to make sure you’re using a capsule, not a box collider!