I was using parallel Lua for bots in my game. In the past few hours, I started getting millions of errors. I’m wondering if it’s related to something I did. I checked my code thoroughly from start to finish but couldn’t solve the issue. The error I’m getting says that task.desynchronize() must be called from a script within an actor, but I’m already calling it from a script within an actor, as the error code itself proves.
This error does not occur when I run it in Studio.
I added a condition to check if the character is in the workspace, and if it’s not, the loop breaks. After doing this, I stopped receiving error reports. However, I still believe something is not working correctly. If you look at the code I posted in the private message section, you will see that I set the ‘enabled’ property of the ‘AI’ script to false before deleting the character. Despite this, the error code is coming from the workspace, and the error code is originating from a script within an actor.
Hey, thanks for waiting, I’m looking in to this now. If you want a quick solution for the time being, try moving any calls to task.(de)synchronize out of pcall! It seems to dissociate scripts from their actors. Nevermind, there’s something deeper going on!
After much more investigation, it turns out this bug was totally on our end, and has to do with Deferred Signals. I’ve created a fix which is currently in review and will keep you updated as it progresses! In the meanwhile, if you change your Workspace’s Signal Behavior to Immediate, this will no longer occur.