Proper way to reference a non-static variable from another script

Okay, so basically I have a script to move my player. In it is a variable that constantly changes called “curSpeed” (current speed) It’s the “current speed” of your ship.
I’m handling all the collisions for this object myself since CharacterControllers are useless, and using a rigidbody to move is just not conducive for this type of game.

Anyway, forget about why I’m asking this, I’d just like some idea because it’s making my brain melt trying to figure it out…

Here I have another script, attached to a child-object of the main player. (The main player being the one with the script with “curSpeed” variable)

In this script I will be calling function OnTriggerEnter()

And inside that function I’ll tell it to destroy the main player (tagged as “YourShip”) if the trigger on this child-object comes into contact with anything.
All that’s easy of course, but to the point…

The problem I’m having here is figuring out how to reference the “curSpeed” variable in this other script… something like this.

if(otherScript.curSpeed > .25)
   Destroy(GameObject.FindWithTag("YourShip"));
   Application.LoadLevel(1);

Basically, if the “curSpeed” variable (in the main player script) is > than .25 (max speed is 1, ignore my numbers :P) then the main player is destroyed and you restart the scene.
But if it is < than .25 then I want it to do something else. I haven’t gotten this far since I can’t get the variable to work so I won’t bore you with what I’ll be doing if it is < than .25.

I just want some kind of guidance. Every method I try results in an error, whether it’s before I press “Play” or after. (Null Reference Exceptions)

http://unity3d.com/support/documentation/ScriptReference/index.AccessingOtherGame_Objects.html

It is explain up here, you need create a variable that will be of the type of the target script then you can access the members. Example, your target is var apple:int; in FruitScript.js attached to the Basket object and you want to access the apple from BuyScript.js

   
var target : GameObject;
var script : FruitScript;

function Start(){
     //Access the object containing the script youwant to modify and assign it to a GameObject var.
     target = GameObject.Find("Basket");
     // In unity a script is a component, you create a var of the script type and fetch the component.
    script = target.GetComponent(FruitScript);
}

function Update () {      
       //Now you should be able to access a member of the target variable 
       script.apple += 2;
    }

An alternative could be to use a message and there is a really easy to understand tutorial here: http://www.unity3dstudent.com/2011/02/beginner-b28-sendmessage-to-call-external-functions/