Animation only playing the idle animation only

Heya.

I’ve made a little animation script which overrides the players animation without having to literally change the animation ID’s inside of the player’s default Animation script. The issue being is that it only seems to play the idle animation only despite the animation’s animationId changing.

--//"Overriding player animation" (Basically playing over animations with a higher piority to show the illusion the player animations changed)
local AnimationIDs = {
	"18614400213", --Idle
	"18626906560", --Walk
}
local Animation = Instance.new("Animation",Character)
Animation.AnimationId = "rbxassetid://18614400213" --Default AnimID
local AnimationTrack = Animator:LoadAnimation(Animation)

Tool.Equipped:Connect(function()
	Humanoid.WalkSpeed = 14
	Equipped = true
	
	Humanoid.Running:Connect(function(Speed)
		AnimationTrack:Stop()
		if not Equipped then return end

		if Speed > 0 then
			Animation.AnimationId = "rbxassetid://"..AnimationIDs[2]
			AnimationTrack:Play()
		else
			Animation.AnimationId = "rbxassetid://"..AnimationIDs[1]
			AnimationTrack:Play()
		end
	end)
	
	Tool.Unequipped:Connect(function()
		AnimationTrack:Stop()
		Equipped = false
		Humanoid.WalkSpeed = 16
	end)
end)
  1. Are you running this in a local or server script?
  2. Are you getting any errors?

You can also look into animation weights

I’ve already somehow managed to figure this out; Apparently I can’t just stop the AnimationTrack and change the animationID before playing it again. I have to make separate animation tracks for each animation (Idle, Walk, Etc).

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