Hi, i have a setup of 7 triggers on a circle floor rotating round with 2 scripts on them . I have a box with a ridgedbody. So when the triggers rotate and hit the box it will call the scripts on the triggers. This does not seem to work.
1st Script CODE:
function OnTriggerEnter (other : Collider) {
if (other.CompareTag (“Player”)) {
SendMessageUpwards (“SetClose”);
}
}
function OnTriggerExit (other : Collider) {
if (other.CompareTag (“Player”)) {
SendMessageUpwards (“SetFar”);
}
}
2nd Script CODE:
var customButton : GUIStyle;
var close = false;
function SetClose () {
close = true;
}
function SetFar () {
close = false;
}
function OnGUI () {
if (close) {
if (GUI.Button (Rect (300,900,150,100), “Menu”, customButton)) {
Application.LoadLevel(“”);
}
}
}