AddRelativeForce only works at Vector3.right or left, not up or down?

Hello, I am trying to make a basic little game. However, my character needs to move around using local AddForce. I had a look around, and I found that the best way to go is AddRelativeForce.

My code;

rigidbody.AddRelativeForce(Vector3.up * forceUp);

However, this does not do anything. It sort of moves the object sideways, but not really.

Help? I don’t know whats wrong.

When I added the code to a cube, it worked fine, but not with my character. Main script:

#pragma strict

var b_thruster : ParticleSystem;
var l_thruster : ParticleSystem;
var r_thruster : ParticleSystem;
var top_thruster : ParticleSystem;

var forceUp : float = 10;
var forceSide : float = 10;

var explosion : GameObject;
var guiShow : boolean;
private var lander : GameObject;
var boost : float = 20;

function Start()
{
lander = this.gameObject;
lander.renderer.material.color = Color.grey; // or whatever
}

function Update()
{	

		r_thruster.particleSystem.Stop();
		l_thruster.particleSystem.Stop();
	
	if(Input.GetAxis("Vertical") > 0) //Checking for up arrow
	{
		rigidbody.AddRelativeForce(Vector3.up * forceUp); //Problem line
		b_thruster.particleSystem.Emit(1);
	}
	
	if(Input.GetAxis("Vertical") == 0) //Checking for no vertical keys
	{
		top_thruster.particleSystem.Stop();
		b_thruster.particleSystem.Stop();
	}
	
	if(transform.position.z > 10) //Checking if inside bounds (R)
	{
	Debug.Log("Outside of bounds! Outside of bounds!");
	transform.position.z = 10;
	}
	
	if(transform.position.z < -10) //Checking if inside bounds (L)
	{
	Debug.Log("Outside of bounds! Outside of bounds!");
	transform.position.z = -10;
	}
}

function Explode()
{
	//var rand : int;
	//rand = Random.Range(0,explosion.length);
	
	Instantiate(explosion, transform.position, Quaternion.identity);
	lander.renderer.material.color = Color.red; // or whatever
	Destroy	(constantForce);
	Destroy (rigidbody);
	guiShow = true;
}

function OnGUI()
{
	if(guiShow)
	{
			if (GUI.Button (Rect (30,70,500,30), "You lost! Restart game?"))
		    {
				Application.LoadLevel ("scene1");
        	}
	}
}

function OnCollisionEnter(hitInfo : Collision)
{
	if(hitInfo.relativeVelocity.magnitude >= 1.5)
	{
	Explode();
	}
}

function RemoveRigid(on : boolean)
{
	if(on)
	{
	Destroy(constantForce);
	Destroy(rigidbody);
	} else {
	//Add the same customized rigidbody
	lander.AddComponent("Rigidbody"); // Add the rigidbody.
    lander.rigidbody.useGravity = false;
    lander.rigidbody.drag = 0.9;
    lander.rigidbody.angularDrag = 0.05;
    rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationY;
    rigidbody.constraints = RigidbodyConstraints.FreezePositionX;
    //Add the constantforce
    lander.AddComponent("ConstantForce");
    constantForce.force = Vector3(0,-5,0);
    //Boost
	}
}

Scripts look ok. Maybe force is too small?

Is your character rotated? AddRelativeForce will add the force in the direction relative to your character, so if the top of your character is pointing left, then adding relative force “up” would actually move him left. Also make sure there’s not a collider in his way; if there’s a collider and you’re running into it he might sort of slowly get pushed along the edge while trying to move past it, which might be the sideways movement you’re seeing.

Thats what I was thinking, with the collider thing – thanks, I’ll make my characters rotation null and see if that does anything.

EDIT: Works perfectly, thanks.