$gameSwitches variable isn't defined

I'm following a YouTube tutorial with RPG Maker MV and Javascript and apparently the variable $gameSwitches doesn't even exist. How to do this?


All I have is an event with the following: $gameSwitches.setValue(1, true);


[IMG]http://i68.tinypic.com/m4gt4.jpg[/IMG]
$gameSwitches doesn't exist until you hit New Game from the title screen.


If you are getting that error, it means you're putting your code in the wrong place.  Please show us the script you've written, and give a link to the tutorial you're following.


Although, looking at your error message, that says you're using gameSwitches, not $gameSwitches.  Have you left out the $ in your script?
Simply rewrote the code and now it works. Seems as though the game had to be run a few times before it was recognized. Nope, did include the $ initially. Sorry and thanks for the reply xD
Running it a few times is not going to make something work that was previously not working.  There must have been an error in the line somewhere that you fixed when you rewrote it.

Original thread: https://forums.rpgmakerweb.com/threads/gameswitches-variable-isnt-defined.72351/