You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
The title explains itself - I have a cutscene that’s made out of multiple animations for each character in it so I can’t use traditional animation events. -
What is the issue? Include screenshots / videos if possible!
I’ve been wondering if there’s any good way of achieving this goal without it being influenced by stuff like frame drops which delays the animation and brought my previous system (see below) out of sync. -
What solutions have you tried so far?
The following code is my previous solution:
for i, tab in ipairs(events) do
local timestamp = tab[1]
local func = tab[2]
task.delay(timestamp, function()
if allowedToProgress == false then
func()
end
end)
end
“events” is a table looking like the example below
Events = {
{3.3, function()
cutsceneModule.Dialogue("Woah", Color3.fromRGB(101, 122, 247))
end},
{8.5, function()
cutsceneModule.Dialogue("Someone help me please", Color3.fromRGB(101, 122, 247))
end},
}
As already stated above, this system doesn’t work flawlessly as when a frame drop occurs while the animations is playing, the system will get out of sync with the animations.
Is there any better way that is dependent of the animations? Thanks!