- Home /
Need help with script and trigger, appearance on screen buttons
Help, please, need a script, when Player stands on the trigger, buttons appear on the screen
Comment
Best Answer
Answer by NWegener · Jun 29, 2012 at 12:18 PM
I don't think I get what you want, but maybe something like this:
private var standsOnTrigger : boolean;
function OnTriggerEnter(col : Collider) {
if (col.gameObject.tag == "Player") {
standsOnTrigger = true;
}
}
function OnTriggerExit(col : Collider) {
if (col.gameObject.tag == "Player") {
standsOnTrigger = false;
}
}
function OnGUI() {
if (standsOnTrigger) {
GUI.Button(...);
...
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613073416im_/https://answers.unity.com/themes/thub/images/avi.jpg)