Exactly as the title states; My rig quickly jolts back to the default “no animation” pose between animation loops. The animation is priority 4 and is looped.
Here is my script:
local hum = script.Parent:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")
local animation = script:WaitForChild("Blacksmith")
local debris = game:GetService("Debris")
local animTrack = animator:LoadAnimation(animation)
animTrack:Play()
-- Function to trigger spark and sound
local function triggerEffects()
local sparkPart = hum.Parent:FindFirstChild("SparkPart")
if not sparkPart then return end
for _, v in pairs(sparkPart:GetChildren()) do
local sounds = script.Sounds:GetChildren()
local randomSound = sounds[math.random(1, #sounds)]:Clone()
randomSound.Parent = v.Parent
randomSound:Play()
debris:AddItem(randomSound, 1)
if v:IsA("ParticleEmitter") then
v:Emit(50)
end
end
end
-- Detect Strike keyframe
animTrack.KeyframeReached:Connect(function(keyframe)
if keyframe == "Strike" then
triggerEffects()
end
end)