I was trying to make a sword and I want it to have animations when the player equip it
I added idle animation but I do not know how to change the player’s walking animation
not only the player walk animation but also other animations such as jump, fall, and run.
I try adding when ever the player is moving it will player the walking animation but it turnout
to be bad and glitchy.
script.Parent.Equipped:Connect(function()
local humanoid = game.Players.LocalPlayer.Character.Humanoid
for _, playingTracks in pairs(humanoid:GetPlayingAnimationTracks()) do
playingTracks:Stop(0)
end
local Anim = humanoid:LoadAnimation(script.Parent.Animation)
Anim:Play()
end)
This will stop the playing animations and then it plays a custom animation
local Anim
script.Parent.Equipped:Connect(function()
local humanoid = game.Players.LocalPlayer.Character.Humanoid
for _, playingTracks in pairs(humanoid:GetPlayingAnimationTracks()) do
playingTracks:Stop(0)
end
Anim = humanoid:LoadAnimation(script.Parent.Animation)
Anim:Play()
end)
script.Parent.Unequipped:Connect(function()
Anim:Stop()
end)
the script is very glitchy I was going for walk animation first
and it ended up not well
I wanted the walk animation to play when the player is walking
not play the animation when the player is equipping
Couldn’t he just change the default animation IDs from the script like this?
Only downside is that OP has to do this for every animation that he wants to override. But it is accurate:
that’s because the animate script updates animations when humanoid’s state is changed
so after changing the animations you have to change the humanoid state
yo, been a hot minute. anyway I can modify this to be a gui instead? i want a walk/run mobile textbutton for those who cant press the shift button. I don’t know how to make it so when you press the button, your animation shall switch