Swing animation isn't overriding other animations?

I made sure that the swing animation has Action priority

The Idle is Idle priority

Idle Script:

local idleid = Instance.new("Animation")
idleid.AnimationId = "rbxassetid://15210978332"

local walkid = Instance.new("Animation")
walkid.AnimationId = "rbxassetid://15212009076"

local playidle,playwalk

local tool = script.Parent

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")

local equipped = false

tool.Equipped:Connect(function()
	equipped = true
	
	if not playidle then
		playidle = hum:LoadAnimation(idleid)
	end
	
	if not playwalk then
		playwalk = hum:LoadAnimation(walkid)
	end
	
	task.spawn(function()
		game:GetService("RunService").RenderStepped:Connect(function()
			if equipped == true then
				if hum.MoveDirection.Magnitude > 0 then
					if playidle.IsPlaying then
						playidle:Stop()
					end
					if not playwalk.IsPlaying then
						playwalk:Play()
					end
				else
					if not playidle.IsPlaying then
						playidle:Play()
					end
					if playwalk.IsPlaying then
						playwalk:Stop()
					end
				end
			end
		end)
	end)
end)

tool.Unequipped:Connect(function()
	equipped = false
	
	if playwalk.IsPlaying then
		playwalk:Stop()
	end
	
	if playidle.IsPlaying then
		playidle:Stop()
	end
end)

tool.Activated:Connect(function()
	
end)
1 Like

It looks like it’s working fine? If it’s not, try setting the swing animation’s priority to Enum.AnimationPriority.Action4. That’s the highest level priority there is.

oh it worked, never had this issue before but thanks

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