Animation event keys not firing all the time they are beeing called

animation has like 1 in 20 to not call the event key as well as .DidLoop.

local f = script.Parent.AnimationController.Animator:LoadAnimation(script.f)
local b = script.Parent.AnimationController.Animator:LoadAnimation(script.b)
local l = script.Parent.AnimationController.Animator:LoadAnimation(script.l)
local r = script.Parent.AnimationController.Animator:LoadAnimation(script.r)
local currentAnim = nil
local pos
local hipBone = script.Parent.RootPart["mixamorig:Hips"]
local spineBone = script.Parent.RootPart["mixamorig:Hips"]["mixamorig:Spine"]
function playAnim(anim)
	local a = 0
	if currentAnim == nil then
		currentAnim = anim
		anim:Play(0)
	elseif currentAnim ~= anim then
		a = currentAnim.TimePosition
		currentAnim:Stop()
		currentAnim = anim
		anim:Play(0,1,0)
		anim.TimePosition = a
		anim:Play(0,1,1)

	end
	currentAnim:GetMarkerReachedSignal("endKey"):Connect(function()
		pos = Vector3.new(spineBone.WorldPosition.X,hipBone.WorldPosition.Y,spineBone.WorldPosition.Z)
	end)
	currentAnim.Stopped:Connect(function()
		pos = Vector3.new(spineBone.WorldPosition.X,hipBone.WorldPosition.Y,spineBone.WorldPosition.Z)
	end)
	currentAnim.DidLoop:connect(function()
		hipBone.WorldPosition = pos
	end)
end

while wait(3)  do
	playAnim(f)
	wait(3)
	playAnim(l)
	wait(3)
	playAnim(b)
	wait(3)
	playAnim(r)
end

it happenes on heavy models with a lot of bones usually from character creation. While mixamo somehow seems to work great.
Edit: found out the bug happens when an event is being hit very fast(fast animation)

We’ve filed a ticket into our internal database for this issue, and will come back as soon as we have updates!

Thanks for flagging!

Could you provide a repro file? Just running the code provided doesn’t work as the animations are missing. Also, could you also provide the KeyframeSequences in the repro file so animations can be re-uploaded? Thanks!

1 Like

if i provide a file the animations wont load since animations can only be run by the player that owns the animations.

Which is why I specified this in my post

Baseplate.rbxl (772.0 KB)

@0Tenth and @Focia19 I Forgot to say: change anim:Play(0,1,1) to anim:Play(0,1,3) to see the bug. I found out that if an event is being passed too quickly it wont fire always
Edit: I updated the place