Ah, that’s quite useful, thanks
Yes, technically that should work fine. Be careful though. With shared state it’s of course very easy to introduce coupling between objects. Remember that the evaluation order of scripts is undefined so you could end up with very hard to find bugs.
Also, if you want to use shared memory between GUI scripts and script components, you need to make sure that you have checked “shared_state” in game.project. Otherwise you’ll get two different Lua contexts for evaluation.
1 Like