- Home /
Game Options In-game
I'm making a Space Sim, and I need an options menu where you can change different aspects of the game (For example: Difficulty, AI count, sound settings, etc.) There's probably no specific script to do things like that, but if there is, and you don't mind posting it, that would be great, (btw, I'm not asking for you to write any scripts for me). Even better would be if you could lead me to some sort of documentation, so I could learn it myself. Thanks in advance.
Answer by Joshua · Aug 22, 2011 at 12:46 AM
Trust me, I've looked at this already. I already know how to do basic GUI, I just want the options to actually affect things in-game. I'm not sure how to approach this.
I'm sorry if my answer was a bit.. unhelpful. But how can you possibly say you understand how to do basic GUI but not how to have it affect things in game?
function OnGUI()
{
if( GUILayout.Button( "Click $$anonymous$$e" ) )
DoSomething();
}
Okay, I know $$anonymous$$OST of basic GUI. I know how to load levels, but that's basic what I meant was changing a variable like number of AI (I'm sorry because I keep saying that over and over)
function OnGUI()
{
if( GUILayout.Button( "Click $$anonymous$$e" ) )
ChangeAICount();
}
Obviously, ChangeAICount won't do anything, even if I set a variable (It's not a float, int, string, etc...). So I just want to know how to maybe connect scripts. Thanks again.
Never $$anonymous$$d I figured it out. Thanks anyway.
Did you use a public variable to pass the value between scripts, or did you pass the value back to the function?
Cheers Chris
Your answer
Follow this Question
Related Questions
Setting Scroll View Width GUILayout 1 Answer
Pause Menu 5 Answers
ignore left mouse button click in the game when using gui buttons 4 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Hey guys, I want to no how to go inside an object with a collider but to still collide with it? 2 Answers