|
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:
(comments are locked)
|
|
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.
(comments are locked)
|

When posting code, make sure it's formatted or people will likely ignore your question. You can see how it's going to look with the preview box as you're writing your question.