Hey guys, I’m trying to implement Packet with parallel luau but there seems to be an issue when assigning the server script to an actor and calling the Packet Module that I created (HelpProblem module). This one:
When calling the HelpProblem module in an actor it seems to create another RemoteEvent. Now this will work if there is only 1 actor which might seem fine but when I added another actor that does the same thing and tried to run it I get this message:
The second actor always returns this error for some reason and I think the reason is because of the duplicate RemoteEvents that is being created? Not too sure.
I want to mention that I called task.synchronise() when calling the HelpProblem module in the server script so it shouldn’t be able to fire the packet module while in parallel (and I think firing events in parallel is illegal in Roblox so it wouldn’t work anyways).
The duplicate RemoteEvents only appears when it is inside an actor and creates a new one for every new actor that calls the Packet Module (HelpProblem module) so when I have multiple scripts that calls the HelpProblem module outside the actors it only uses 1 which is expected:
Then in test 2 I tried creating a module script (CallAtOnePlace module) so that the scripts in the actors can access one point instead of calling them in each actor individually but it also didn’t work:
In theory all these should create one RemoteEvent only since its still running serially on the main thread, but instead it create’s multiple RemoteEvent’s.
Right now my current solution is to just create another RemoteEvent in ReplicatedStorage and directly sending it to the client.
I’m not sure if there is a way to get around this using Packet but please let me know! Thanks for reading!
Here is the Place file if you want to test: HelpProblem.rbxl (73.8 KB)
I want to mention that I commented out task.wait() in one of the Actors to show the error, but enabling/uncommenting it should work the same, I did this because it spams the output a little bit and to make it easier to see the error.
Also I apologise for the many edits, I initially created this post on mobile then moved to PC to finish it along with the errors in the post
Thanks for reporting this problem ill try to add actor support in the next update but it could be problematic because each actor wont be able to share the same buffer and so it wont be able to batch events from each actor together
is this supposed to happen? Shouldnt it simplify it as one call? Or does it add one per key (event)?
If it should work like this then just heart this message instead of replying to save everyone some effort lol
Seems this happens generally, so its not some weird “server-client-boundary-mix”-messup. In that case I naturally assume it has something to with my code.
Ok I think I replicated the problem let me see if I can find why its doing it
I think it is happening because when you fire a event every frame it does not always mean the client will read them both in separate frames the event can reach the client on the same frame
oh wow I’m emberassed to say that most of the used scripts were in an actor (i didnt even know )
I searched for all actors (using classname=“actor” in the search bar) and moved the scripts but it still appears to be uhh… doing it
Ill check for more scripts that may be somewhat hidden in their actors
EDIT: I didnt find any other actors. Also if I might add it seems like both of these calls came from the same script anyways (awfully similar buffers), in which case (I believe) it wouldnt even matter if they were parented to an actor.
notice how there are gaps this is because each event does not have a fixed time
so by the time the client gets the event multiple events can overlap one another
the only way we could stop that from happing would be to batch multiple frames but then it would introduce extra latency and I would not want to do that