run_on_actor) don’t share _G or shared. Open a channel to bridge that gap: call create_comm_channel() on one side, send the returned id to the other side, and both sides talk over the same event.
The second return value is a Roblox BindableEvent. Use :Fire(...) to send a message. Use .Event:Connect(...) to receive one, or .Event:Wait() to yield until the next message arrives.
Returns
A tuple:
Both values are
nil if the channel could not be opened.
Example
The main thread opens a channel, connects a handler, and starts a worker thread with the id. The worker resolves the same channel withget_comm_channel, fires two messages back, and the main thread catches them on .Event:Connect.