Help on animation going off

i used this tutorial btw: How to animate Tool Parts (Guns, Knifes etc.)
Server script:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		task.wait(2)
		local clone = game:GetService("ServerStorage").Gun:Clone()
		clone.Parent = char
		local anim = workspace.Animation
		local loadedanim = char.Humanoid.Animator:LoadAnimation(anim)
		local newmotor6d = Instance.new('Motor6D',clone)
		newmotor6d.Part0 = char:WaitForChild("Right Arm")
		newmotor6d.Part1 = clone.BodyAttach
                loadedanim.Looped = true
		loadedanim:Play()
	end)
end)

This happens:


As you can see in the video, the 1-second animation plays, and then the animation stops
But in the tutorial, the animation stays, and it’s like holding the gun, and in my game the animation plays and goes off, how do I fix it?

I want the animation to stay and it should look like I’m holding the gun, but as you can see the animation plays and the rest is undescribable.

2 Likes

This is most likely not a script issue but an AnimationPriority issue. Try setting it to Action and it shouldn’t get overwritten.

1 Like

maybe you forgot to loop it dude

2 Likes

It is Action already

Um isn’t this line loop loadedanim.Looped = true

Try creating the motor6Ds first and then loading the animation…