local animator = player.Character.Humanoid:WaitForChild("Animator")
local anim = animator:LoadAnimation(player.Character.Animation)
local function onUpdate()
if player.Character and player.Character:FindFirstChild("Humanoid") then
if down == true then
anim:Play()
anim.Looped = true
end
end
end
i want the animation to play when I hold it, however, it becomes stuck at the start if I hold it, but plays normally when i let go???
It’s because the script is replaying the animation every time you call the update function. You haven’t shown us half the code though so we can’t help.
yes but i have3 to stop it at some point, i am trying to make it so the animation plays when the down is true and stops when it is false
if down == true then
--player.Character.HumanoidRootPart.ANG.AngularVelocity = Vector3.new(0,0,math.rad(number/2))
anim:Play()
anim.Looped = true
else
anim:Stop()
end
however its just stuck so the cde in the first post is me trying to debug it