Problems With Pet Animation

Hi,

So I made a pet walking animation that plays whenever you walk.
But the problem is that the pet walking animation is perfect when walking for like 5 seconds but then it starts sliding. I will provide some more informations below.


The animation is looped :
image

The animation priority is Movement :
e

And this is the part of the code which makes the animation play when the humanoid is walking :

local function Follow(pet)
	local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
	local BodyPosition = Instance.new("BodyPosition", pet:WaitForChild("Pet"))
	BodyPosition.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
	local BodyGyro = Instance.new("BodyGyro", pet:WaitForChild("Pet"))
	BodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
	Character.Humanoid.Running:Connect(function(speed)
		local MovementAnimationTrack = pet:FindFirstChild("AnimationController"):FindFirstChild("Animator"):LoadAnimation(pet:FindFirstChild("Animations"):FindFirstChild("Movement"))
		if speed > 0 then
			MovementAnimationTrack:Play()
			MovementAnimationTrack:AdjustSpeed(2)
		end
		if speed == 0 then
			MovementAnimationTrack:Stop()
		end
	end)
	while wait() do
		BodyPosition.Position = HumanoidRootPart.Position + PetPosition
		BodyGyro.CFrame = HumanoidRootPart.CFrame
		pet:WaitForChild("Pet").Orientation = HumanoidRootPart.Orientation + Vector3.new(0,180,0)
	end
end

Any help is appreciated!

maybe change it to action?? because i once had my animations set to movement and they never worked

1 Like

Woah that was as simple as that…

Anyway that worked so thanks :slight_smile: