Hi, I’m trying to make a script which plays an animation when you touch a part and doesn’t stop. However, when I move the animation stops playing. Does anyone know how to fix this?
this is my code:
function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
local anim = human:LoadAnimation(script:FindFirstChild("Animation"))
anim.Looped = true
anim.Priority = Enum.AnimationPriority.Action
if human then
anim:Play()
end
end
script.Parent.Touched:connect(onTouched)