Hello. I have written a simple platform script that works by replacing a tile with an identicle tile without a collider. Is there anyway to make it only work if you hit a trigger collider? The problem is that if I save this in my project and create multiple copies they will all follow the script at the same time. Please help.
var Platform1 : GameObject;
var Platform2 : GameObject;
function Start () {
Platform1.active = true;
Platform2.active = false;
}
function Update () {
if(Input.GetMouseButtonDown(1)){
Platform1.active = false;
Platform2.active = true;
}
if(Input.GetMouseButtonUp(1)){
Platform1.active = true;
Platform2.active = false;
}
}