Creating custom walk animation with tool equipped

I am attempting to create a tool equip system after following Headstackks weapon tutorial. I have created a working animation successfully however now having huge issues with setting a custom walk animation for the tool specifically.

I have looked all over devforum but cannot find anything to cater to what I am requiring.

To break this down simply, I have two animations: One for the withdrawal of the sword in my inventory, one for the idle position where it rests.

Animation 1.
RobloxStudioBeta_mdFB2UNPsq

In the animation above, you can see the sword goes back into it’s original position which gives it an undesirable effect. This is why I have created an idle animation, see below.
RobloxStudioBeta_4g6jR0ITVm

This animation ^ is just to keep the item in place and to simulate the look of “breathing”.

Now here is my walking animation(crappy, I know.)
RobloxStudioBeta_ykxH5IxL6o

The issue I face, with this entire script, is that when equipping the tool, everything is fine. But when I want to change the players WALK animation to a custom one via the default roblox animator script, the walking animation does not get affected (see last image wetransfer as file to big)
image

local animTable = {}
local animNames = { 
	idle = 	{	
				{ id = "http://www.roblox.com/asset/?id=507766666", weight = 1 },
				{ id = "http://www.roblox.com/asset/?id=507766951", weight = 1 },
				{ id = "http://www.roblox.com/asset/?id=507766388", weight = 9 }
			},
	walk = 	{ 	
		{ id = "http://www.roblox.com/asset/?id=82707642957191", weight = 10 } 
			}, 

(snippet above)


local player = game.Players.LocalPlayer

local char = player.Character or player.CharacterAdded:Wait()
char.ChildAdded:Connect(function(child)
	if child:IsA("Tool") and child:FindFirstChild("Handle") then
		print(typeof(child))
		print(child)
		char.UpperTorso.ToolGrip.Part1 = child.BodyAttach
		char.UpperTorso.ToolGrip.Part0 = char:FindFirstChild("UpperTorso")
		print("upertorsoo")
	end
end)


local anim = Instance.new("Animation", script.Parent)
local anim2 = Instance.new("Animation", script.Parent)
local walkAnim = Instance.new("Animation", script.Parent)
anim.AnimationId = "rbxassetid://76383156872232"
anim2.AnimationId = "rbxassetid://130872886887471"
walkAnim.AnimationId = "rbxassetid://82707642957191"
local load = char:WaitForChild("Humanoid").Animator:LoadAnimation(anim)
local load2 = char:WaitForChild("Humanoid").Animator:LoadAnimation(anim2)
local walkAnimation =char:WaitForChild("Humanoid").Animator:LoadAnimation(walkAnim)
load.Priority = Enum.AnimationPriority.Action
load2.Priority = Enum.AnimationPriority.Idle;
walkAnimation.Priority = Enum.AnimationPriority.Movement

--script.Parent.Unequipped:Connect(function()
--	game.Players.LocalPlayer.Character.Animate.Enabled = true;
--	game.Players.LocalPlayer.Character.SwordA.Enabled = false;

--end)
script.Parent.Equipped:Connect(function()
	local tool = script.Parent


	if char:FindFirstChild("UpperTorso") and tool:FindFirstChild("BodyAttach") then
		local toolGrip = char.UpperTorso:FindFirstChild("ToolGrip")
		if toolGrip then
			toolGrip.Part1 = tool.BodyAttach
			load:Play()
			load2:Play()
			load2.Looped = true;
			load2:AdjustSpeed(0.4)
			print("Test")
			--game.Players.LocalPlayer.Character.Animate.walk.WalkAnim.Priority = Enum.AnimationPriority.Core
		end
	end
end)
char.Humanoid.Running:Connect(function(speed) --walk animation
	print("hi")
	load2:Stop()
	walkAnimation:Play()
	load:Stop()

end)

This is the end result I get running this script. I did a lot of testing and believe that the idle animation is taking priority over the walking animation, but when adjusting the values from Action to Idle vice versa the animation comes out all wrong. (sent as a weTransfer as file too big for here)

For anyone asking, I have tried changing the walk animation through the .Running event, did not seem to help in my use case

Any help would be appreciated.

1 Like

The walking animation may not be working because the Priority is too low, the animations Priority must be Action or higher to override the running animation in the default Roblox Animate script.