I'm trying to make an animation not run a second time until it is finished running the first time. The problem is, however, that the animation only runs once because the KeyframeReached event does not fire. This is a local script in starter gui and nothing appears in the output -- at all.
local plr = game.Players.LocalPlayer repeat wait() until plr.Character local hum = plr.Character:WaitForChild("Humanoid") local mouse = plr:GetMouse() local anim = workspace:WaitForChild("Animation") local canPlay = true mouse.KeyDown:connect(function(key) if key:lower() == "q" and canPlay then canPlay = false local animTrack = hum:LoadAnimation(anim) animTrack.KeyframeReached:connect(function(name) print("fired")--Does not print print(name)--Does not print if name == "End" then canPlay = true end end) animTrack:Play() end end)
The only possibility I can think of is that the animation only has one keyframe, but I'm doubtful that the aforementioned instance is the case. Unless the issue has to do with a bug in animations, the issue is most likely how you ran the script. Also, the issue could also be with the script itself( other scripts tampering with the script ).