Cant call function in js another script

Hello there, first post after lurking for a while.
I am experimenting with the zigfu toolbox and a kinect. I created a collision with the hand object and a trigger for basic interaction. I want to change a mapping on collision on a third object. I use two scripts that interact with each other. I used the following resource: Unity - Scripting API: GameObject.GetComponent

The collision works fine but when i want to trigger the function in the other script it states “object not set to an instance of an object”. I do however set the instance in the top of the script and it doesnt give a error on compiling that, only on runtime at the actual collision.
The trigger-script is as follows:

var other : change_mapping;
other = gameObject.GetComponent("change_mapping");

function OnTriggerEnter (myTrigger : Collider) {
	if(myTrigger.gameObject.name == "TriggerObject"){
		Debug.Log("Box went through!");
		other.ChangeTex01();
	}
}

I assigned the Other var to the gameobject containing the change_material script.
The change_mapping script is as follows:

public var tex01_texture	:	MovieTexture;
public var tex02_texture	:	MovieTexture;
public var temp_tex		:	MovieTexture;
public var current_tex	:	MovieTexture;

function Awake() {
	current_tex = temp_tex;	
}

function Update () {
	renderer.material.mainTexture = current_tex; 
}

function ChangeTex01(){

	Debug.Log("change tex01");
}

function ChangeTex02(){

	Debug.Log("change tex02");
}

I feel kinda dumb because there are many posts like this but i just cant get it to work after a day of fidling and googling. Does anybody have a idea? Thanks in advance :slight_smile:

The issue is that GetComponent is not finding anything. GetComponent searches only for components attached to the current object, so if your script is on a different object (which I believe you said it was), it won’t find anything. You have to specify the object the script is attached to, using something like this:

var obj : GameObject = ...//Get a reference to the object holding the script here
obj.GetComponent(change_mapping).ChangeTex01();