(Note: I’d post this in the Bugs section but I can’t create a topic there.)
I have the following issue, which seems like a bug in the KeyframeSequenceProvider:GetKeyframeSequenceAsync function.
If you call KeyframeSequenceProvider:GetKeyframeSequenceAsync multiple times in quick succession inside a coroutine it won’t correctly download the animation.
Where it happens: when running the game from Studio.
When it happens: as soon as the code is ran at start (it seems that if the animation loads that this error does not happen, so the example script must be ran as soon as possible).
Reproduction steps:
- Create a part
- Attach the given script to it
- Run the game: the error should trigger.
What should happen:
The keyframes with 2 animation markers should load: “AttackStart” and “AttackEnd”.
What actually happens:
The keyframes are missing, so the markers are also not loaded.
Though if you continue from the 1st error sometimes the animation keys are then loaded correctly.
This is the script to execute, just attach it to any part.
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
for i=1,5 do
coroutine.wrap(function()
local KeyframeSeq = KeyframeSequenceProvider:GetKeyframeSequenceAsync("rbxassetid://6979253696")
print("!!!!! Printing: ")
local bWereMarkersFound = false
local Keyframes = KeyframeSeq:GetKeyframes()
for _,Keyframe in pairs(Keyframes) do
local MarkersInKeyframe = Keyframe:GetMarkers()
for _,IterMarker in pairs(MarkersInKeyframe) do
bWereMarkersFound = true
print("!!!!! Marker: " .. tostring(IterMarker.Name))
end
end
if bWereMarkersFound == false then
error("markers not found")
end
end)()
end