So i am bit confuse about the game variables. I working on a custom file saver class since this a pc game and will appdata folder that i am storing assets and other stuff.
I went to editor->Game Variables
and defined a new variable called "FilePath"
Then I went to Game->Game Setting
and added Change Variable to the Initial Game Variable
game varible


then in my class i called:
if (ORK.Initialized)
{

var test = ORK.Game.Variables.GetString("FilePath");
}
but test is null.

I dont know if I am doing something wrong.
  • In the value type, instead of putting Game Variable, try putting Value.
  • if i change the Value Type under Variable Key to Value from Game Variable then ORK.Game.Variables.IsEmpty is still true

    Basically, I want to set up some global variables that can be edit by me and other designers on the fly. I understand how to create this variables by script but i want to be able to edit them in the ui.
  • As @Shadow_Fire said, you need to use the Value type for the variable key, otherwise you'd use the value stored in the variable 'FilePath' as variable key.

    The initial variables are only initialized in a running game after ORK has been initialized (e.g. through the game starter). A string variable will never return null, if it doesn't exist, it'll return an empty string.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.