Hello!
Not a big time scripter here, very basic knowledge.
I’m currently working on making a small cutscene transition for my current project that uses multiple functions with several “task.wait()” events and I am trying to find a way to have multiple functions play at the same time without the task.waits interfering with each other and causing delay if that makes sense.
I’m actively searching for a solution to this issue and will close this thread if I find one, but in the meantime if anyone knows how to solve this issue and can lend me a hand it would be greatly appreciated.
Your waits arent the actual problem the functions are all running in the same thread, so each task.wait() yields the whole sequence
Run each cutscene action in its own thread:
task.spawn(function()
cutscenePart1()
end)
task.spawn(function()
cutscenePart2()
end)
task.spawn(function()
cutscenePart3()
end)
task.wait() only pauses the thread its in, so once they r spawned separately the delays wont block each other and the cutscene parts can play simultaneously
It is important to mention that this is all still running single-threaded, task.spawn does not call thread creation, it just alters how the current thread runs code, making execution “jump around” between your task.spawn(s).
In Luau we have actors that let us carry out actual multithreading, however for a cutscene this would be completely unnecessary ⚆_⚆