So I have finally finished my movement system for my game but found that my running animation is overriding everything else when it’s being played. I also put my code here just incase the code is messing something up. Inform me if you figured out what’s wrong because it is really messing it up.
local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 35 --run speed
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://15564406328'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
end
end)
UIS.InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Character.Humanoid.WalkSpeed = 16 --default walk speed
PlayAnim:Stop()
end
end)