Is there a way to check if the current task is Synchronized or Desynchronized?

Besides sending extra info to a function depending, is there a function to just check the current running task status?

1 Like

Currently, no. There was a feature request for it but it doesn’t look like it was ever followed up upon.

Currently it looks like the workaround is to wrap a parallel unsafe operation (like a property assignment or unsafe method call) in a pcall, but this hacky and not future proof

2 Likes

Use a simple flag to change when you’re synchronizing and desynchronising.

local issynchronised
r = false
task.desynchronize() -- Assume current script is under serial execution phase
...
r = true
task.synchronize()

Now I don’t know if this would work well since I haven’t tested it but its what I could think of

you’d still have to track this variable across multiple scripts and functions, syncronizing is not a global thing for an entire script, just for the task.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.