How to use actors in modular programming?

Hi , I am trying to make a game . I organise the game by using a modular approach where there is only one server and one local scripts . Those 2 scripts load all the modules and the modules are the one that run code . I am wondering how do i use actors in this case?

you can’t run code in parallel only using modulescripts, so what i’ve done in the past is create a “base script” that contains everything to be run in that vm and then clone that script to a new actor whenever needed, interacting with it via BindToMessage/SendMessage
getting data back from a different vm is a massive pain though, i tend to avoid it but it can be done via a BindableFunction or two BindableEvents

1 Like