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)