Hello. These are the scripts for selecting the options for my game (mode, difficulty, etc.). How it works is that the menu are a bunch of toolbars. Each toolbar option selected represents a number, that number represents a number in a different script, and that other script contains the functions that start the options (like "Standard difficulty=true")
If I define something to happen in the script that has the toolbat GUI like this, the other variable (in this case, "Score") works, Its changed to whatever is defined.
I then tried to make a variable in the GUI script affect a variable in another script (in this case the "ArcadeOptions" script) :
(Here is the ArcadeOptions Script)
static var Mode = 5;
and it works, the Score value is changed.
The problem happens when I try to have the "ModeInt==" something other than 0(so that other buttons can affect the "ArcadeOptions" script). No matter what the element of that toolbar is, if it is not 0, nothing happens in the other script, what is going on(I am getting no errors from unity)?
asked Dec 13 '10 at 02:11 AM
You need to create a reference to the instance of the first script.
answered Dec 13 '10 at 03:17 AM