- Home /
Question by
WaterMinecraft · Nov 12, 2014 at 02:33 AM ·
gui3dtextoptions
How to activate OnGui with 3D Text
(CODE BELOW ^_^) So I have a 3D Text that I am clicking on with a collider that acts as a trigger. I have a boolean declared as "options" to be set to true when I click the 3D Text. I have in my OnGui function options that when true should make buttons appear on screen... However, the issue is that my buttons don't seem to show up.... So yeah! Code is below if anyone can help me!
~WM
var options = false;
function OnMouseUp(){
options = true;
}
function OnGui(){
if(options){
GUI.Box (Rect (10,10,100,90), "Loader Menu");
if(GUI.Button(Rect(Screen.width/2 - 50, Screen.height/2, 100, 30), "General")){
options = false;
game = true;
}
if(GUI.Button(Rect(Screen.width/2 - 25, Screen.height/2, 100, 30), "Input")){
options = false;
input = true;
}
if(GUI.Button(Rect(Screen.width/2, Screen.height/2, 100, 30), "Graphics")){
options = false;
graphics = true;
}
if(GUI.Button(Rect(Screen.width/2 + 25, Screen.height/2, 100, 30), "Audio")){
options = false;
gameAudio = true;
}
if(GUI.Button(Rect(Screen.width/2 - 50, Screen.height/2 + 90, 100, 30), "Input")){
menu = true;
}
}
}
Comment
Best Answer
Answer by incorrect · Nov 12, 2014 at 02:59 AM
You made a mistake. It should be OnGUI(), not OnGui(). It's case sensitive and does not through an error.
Your answer
Follow this Question
Related Questions
I want pixelated unicode text. Need suggestions... 2 Answers
How to save 3d text 1 Answer
Dropdown button... 0 Answers
Cant change color of 3dText/Text Mesh 3 Answers