its annoying me that unity wont let me call a GUI Button function in an OnTriggerEnter function after the if statement. I want to make instructions come up when you enter a trigger, but unity tells me that the I can only call GUI functions from inside OnGUI(). any ideas around this?
heres the script so far:
You'll find lots of info for your problem by searching for "pause menu" and the like in the search box. This one here seems to be a pretty decent solution; just substitute an
Essentially, whatever you put in OnGUI is going to get called every frame. To get the behaviour you want, you have to enable and disable the buttons/text according to an outside condition.
answered Jul 18 '11 at 08:45 PM