taylormorris Posted April 6, 2015 Share Posted April 6, 2015 We are trying to pass a couple variables between a menu world and a game world. For example: selecting a character in the menu world, and then using this selection variable to decide what mesh to spawn in the game world, after it has finished loading. Is there a function or option to persist a script or node between worlds? Something besides writing to and reading from a temporary data variable For reference: in Unity, there is the DontDestroyOnLoad function for GameObjects/Nodes - http://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html Thanks! Link to comment
taylormorris Posted April 6, 2015 Author Share Posted April 6, 2015 Nevermind! We found a solution by getting and setting public variables in the system script (unigine.cpp). As mentioned here https://developer.unigine.com/en/docs/1.0/code/execution_sequence/, the system script is persistent across all worlds. Once variables are declared in the system script, your functions are just engine.system.get and engine.system.set - nice and easy! Link to comment
Recommended Posts