I have various scripts in my game that need a particular variable. At the moment I’m sending messages to the script that contains that variable and in turn that script sends back the variable in another message.
The issue is there seems to be a delay in getting that number back - the code doesn’t seem to work linearly and this is a real issue when you need to access the variable quickly. Is there anything in the documentation that outlines the best ways to get a variable immediately from another script?
Like Ragnar said, script properties and go.get() and go.set() is probably your best bet. You could also look into storing some kind of shared data in a Lua module that you require() from where ever you need to access the data.