Recently I decided to use actors for my project, I mainly use things like shared
to pass data globally on both client and server which saves me and my team lines of code to transmit, and also is responsible for a lot of our player based variables.
Recently I have decided to utilize actors to make our experience run smoother, but have met an issue: If a script is placed under an Actor
, they will not be able to see shared
that other local scripts that aren’t under an Actor
can see, same way scripts outside cannot see any changes done to global variables inside of the script inside of the actor.
Example:
-- Script under an actor
shared.Modules = {}
shared.Modules.Test = require(...)
-- Script that has a normal parent
repeat wait(.25) until shared.Modules -- Continues forever as it cannot see changes done to global variable in prior script.
Is there any sort of fix to this without forcing us to re-write entire systems? I understand that whole point of this is to use different cores of the device and may not have the access like rest of the threads.