How to make a Animation play more than once?

Hey!

I am trying to add a shooting animation to my game, and I am wondering how I can make the animation play when the player is holding down the mouse button?

Here is my script:

mouse.Button1Down:Connect(function()
	ShootAnimation:Play()
end)

mouse.Button1Up:Connect(function()
	ShootAnimation:Stop()
end)

When I tested it the animation played well with one click. But when I held the mouse buttton, it only played once and then it stopped. Please let me know how I can fix this issue.

Sincerely,

papahetfan

When in the animation editor there is an option to make the animation loop

here:

mouse.Button1Down:Connect(function()
    ShootAnimation.Looped = true
	ShootAnimation:Play()
end)

mouse.Button1Up:Connect(function()
	ShootAnimation:Stop()
end)
1 Like