I can't have more than one raycast in one script?

I’ve tried putting them in 2 separate functions, and deactivating one raytrace through a boolean if statement, but I still can’t get both of them to work. Both of them should work, but why is only one of them working and not both of them?

#pragma strict

var Strength : float = 0.004;

var MinHeight : float = 2;
var MaxHeight : float = 10;

var ReadHeight : boolean;

function FixedUpdate () {

if (ReadHeight == true){
ReadHigh();
}

if (ReadHeight == false){
ReadLow();
}
}

function ReadHigh () {
if (Physics.Raycast (transform.position + Vector3(0,0,0), transform.up, MaxHeight)) {

		rigidbody.AddForce(Vector3.up * 0);
		} else {
		rigidbody.AddForce(Vector3.up * -Strength);
		}
}


function ReadLow () {
if (Physics.Raycast (transform.position + Vector3(0,0,0), transform.up, MinHeight)) {

		rigidbody.AddForce(Vector3.up * Strength);
		}
}

Your code looks like it should be branching correctly. This can be confirmed by adding a couple of debug lines like this:

function ReadHigh () {
    Debug.log("ReadHigh");
    Debug.DrawRay(transform.position + Vector3(0,0,0), transform.up * MaxHeight, Color.red);
    if (Physics.Raycast (transform.position + Vector3(0,0,0), transform.up, MaxHeight)) {
        rigidbody.AddForce(Vector3.up * 0);
    } 
    else {
        rigidbody.AddForce(Vector3.up * -Strength);
    }
}
 
function ReadLow () {
    Debug.log("ReadLow");
    Debug.DrawRay(transform.position + Vector3(0,0,0), transform.up * MinHeight, Color.blue);
    if (Physics.Raycast (transform.position + Vector3(0,0,0), transform.up, MinHeight)) {
        rigidbody.AddForce(Vector3.up * Strength);
    }
}

This will write to the console and draw some lines in the game window to show which method is being called.

If it is branching correctly but not causing the correct behaviour in game then I suggest refining the values passed to rigidbody.AddForce().