- Home /
How to make a var "global"
I have a problem with a "level-system". There is a scene with levels (1,2,3 etc...) they are like "buildings" If you win a level, the cam moves to the next building, and the Player spawns at a position. But if the player dies i want to reload the stage. (because there are moveable objects and stuff i want to replace and switches i want to turn off again)
I tried to slove this with a static var: currentlevel. If the screne is reloaded the cam gets the var and know what level the player died last time... and moves there.
but every time i want to change this static var, an error appears: "cannot convert system.type to int" or "the operator "++" cannot be used with an expression of system.type"
Am i doing somthing wrong or is there a better way to slove this? Thanks for your attention. :)