Equipping Sword Animation controls normal roblox walking animation

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want to make when the equip animation plays, the walking roblox animation also play

  2. What is the issue? Include screenshots / videos if possible!
    the normal roblox walking animation doesnt play when equip animation play

  1. What solutions have you tried so far?

I already tried to search on yt,google and others but still didnt found any results

Here’s the code

local player = game.Players.LocalPlayer

repeat wait(1) until player.Character

local character = player.Character
local humanoid = character:WaitForChild("Humanoid")

local EquipSound = script.Parent.Handle.Equip

local animation = script.Animation
local animtrack = humanoid:LoadAnimation(animation)
local equipAnim = humanoid:LoadAnimation(script.EquipAnimation)

local Handle = script.Parent.Handle

script.Parent.Equipped:connect(function()
	equipAnim:Play()
	
	Handle.Transparency = 1
	Handle.Trail.Enabled = false
	wait(0.3)
	EquipSound:Play()
	Handle.Transparency = 0
	Handle.Trail.Enabled = true
	
	humanoid.Running:Connect(function(speed)
		if speed > 0 then
			animtrack:Stop()
		elseif speed == 0 then
			animtrack:Play()
		end
	end)
end)

script.Parent.Unequipped:connect(function()
	animtrack:Stop()
	humanoid.Running:Connect(function(speed)
		animtrack:Stop()
		if speed > 0 then
			animtrack:Stop()
		else
			animtrack:Stop()
		end
	end)
end)
3 Likes

I don’t think you can fix this problem cause you can’t play 2 animations at the same time ofc but you could maybe try to make a second animation that if your walking while equipping it you will also walk while your equipping it but if you don’t walk the other animation would play so that it would be fixed I have no other ideas then this.

or you could also make the player stop walking while doing the animation.

Do you only want the walking animation to play or you want to move the player forward?

Don’t animate legs while making the sword animation

1 Like

Playing 2 tracks is simple. Just set the animation priority to the correct priority of the animation and you should be good to go.
More here: AnimationTrack | Roblox Creator Documentation

Remove leg keyframes and set the animation priority higher

Hmm can u show to me how to make player stop when animation play?

I might use it in the future.

just check if the player’s animator is playing an animation, if yes then set the walkspeed to 0

Set WalkSpeed of the player’s Humanoid instance to 0, do the same for JumpPower. You can also Anchor the HumanoidRootPart to prevent the player’s character rotating.

local player = game.Players.LocalPlayer or game.Players.PlayerAdded:wait()
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")

humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
local player = game.Players.LocalPlayer or game.Players.PlayerAdded:wait()
local character = player.Character or player.CharacterAdded:wait()
local HMR = character:WaitForChild("HumanoidRootPart")

HMR.Anchored = true

For this, you can use PlayerModules:

local LocalPlayer = game:GetService("Players").LocalPlayer
local Controls = require(LocalPlayer.PlayerScripts.PlayerModule):GetControls()

Controls:Disable()

You can also say Controls:Enable() to let the player move again.
For the animation, it may work to animate the legs to walk in the SAME animation as the equip animation, if that makes any sense.

This is very easy to fix in ur animation program u have keys, the problem with this that u had keys of the animation at the legs, delete these legs keys off the animation and it should equip while walking. Hope this works!

1 Like