Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Sprinting animation works while not moving?

Asked by
kolenk 9
5 years ago

So basically Im trying to make a sprinting animation but if you're standing still and hold shift the animation plays even though you're not moving any help please?

01uis = game:GetService("UserInputService")
02plr = game.Players.LocalPlayer
03character = game.Workspace:WaitForChild(plr.name)
04Character = plr.Character
05 
06 
07uis.InputBegan:connect(function(input)
08    if input.KeyCode == Enum.KeyCode.LeftShift 
09        then
10 
11            character.Humanoid.WalkSpeed = 30
12            local Anim = Instance.new('Animation')
13  Anim.AnimationId = 'rbxassetid://3726121052'
14  PlayAnim = Character.Humanoid:LoadAnimation(Anim)
15  PlayAnim:Play()
View all 28 lines...
0
You might want to add another keycode so that the animation only works if you are pressing an arrow key with it. StoryOfWhat -5 — 5y
0
Maybe add a humanoid.StateChanged to check if he is on a running state and then check if its holding LeftShift then the animation plays Dfzoz 489 — 5y
0
not sure what you mean by that? kolenk 9 — 5y

Answer this question