Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i stop the roblox animation from overlapping with my animation?

When I walk forward it plays my animation, but i can also tell it plays the roblox walking animation aswell

humanoid = script.Parent.Parent.Humanoid
Running = script.Parent.Running
runAnim = humanoid:LoadAnimation(Running)

script.Parent.Equipped:Connect(function()
	humanoid.Running:Connect(function(speed)
		if speed >1 then
			
			runAnim:Play() --plays my animation
		else
			runAnim:Stop() --stops my animation
			
		end
	end)
end)

1 answer

✓ Accepted answer

Your script is pretty solid, however I recommend doing this to prevent your script from breaking due to an error.

humanoid = script.Parent.Parent.Humanoid
Running = script.Parent.Running

pcall(function()
	runAnim = humanoid:LoadAnimation(Running)
end)
	 
script.Parent.Equipped:Connect(function()
	humanoid.Running:Connect(function(speed)
	        if speed >1 then
	 
	            runAnim:Play() --plays my animation
	        else
           	    runAnim:Stop() --stops my animation
	 
	        end
	end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.