Most likely you’ve overridden those values in the inspector.
If you’re using global variables, just declare them as static. They don’t show up in the inspector, you don’t have to attach your Game_State script to anything, and you don’t have to use FindObjectOfType or GetComponent to access them:
Thats pretty cool - and it works perfectly. Thanks a lot!
However, is there a way to make those static variables appear in the inspector? Kinda nice to change them via that pane, or at least view them. Nothing crucial, though, I can live without it
Generally you’d have to write a custom editor to get static variables to appear in the inspector.
But if you just want to initialize the values, you could write an initialization script that has public variables and then during Awake() set your static variables to those:
var startingLives = 3;
function Awake(){
GameState.lives = startingLives;
}