I cant get this animation to work

local UserInputService = game:GetService("UserInputService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local crawlAnim = humanoid:LoadAnimation(script:WaitForChild("CrawlAnim"))
local isCrawling = false

humanoid.Running:Connect(function(speed)
	if speed > 0 then
		crawlAnim:AdjustSpeed(1)
	else
		crawlAnim:AdjustSpeed(0)
	end
end)

UserInputService.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		if not isCrawling then
			isCrawling = true
			crawlAnim:Play()
			crawlAnim:AdjustSpeed(0)
			humanoid.WalkSpeed = 8
			humanoid.JumpPower = 0
		else
			crawlAnim:Stop()
			humanoid.WalkSpeed = 16
			humanoid.JumpPower = 50
			isCrawling = false	
		end	
	end
end)

also it has an animation inside of it called “CrawlAnim”

1 Like

Is the animation looped or being replayed by the script?

1 Like

Loop the animation instead of pausing it

1 Like

i edited it to loop it and the animation still won’t play properly

1 Like

It might be that the Roblox default animations are being played along with the crawl animations (if your animation doesn’t animate arms). Also, Set the animation priority of your animation to be action.

1 Like

yeah this was the problem thank you

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.