Won't change to running animation

my script won’t change to the runnning animation i put into starterplayerscripts.

so i just want to play a running animation when one of the shift’s is activated, and when deactivated it starts playing the walking animation again

script:

local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer

local usualplayerspeed = 12

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift then
		player.Character.Humanoid.WalkSpeed = 20
	end
end)

UIS.InputEnded:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift then
		player.Character.Humanoid.WalkSpeed = usualplayerspeed
	end
end)
2 Likes

Walking animation starts anywhere below 16, try setting it to 16+

2 Likes

setting what to 16+, the normal walkspeed or running

1 Like

local usualplayerspeed = 12
the value is lower than 16. Try setting it more than 16 or just 16 for default walkspeed of the player

1 Like

the problem is starting up the running animation, not ending it(also if i sound mean, i dont mean to be, just that im tired)

1 Like

i tried this, and it doesnt seem to work

1 Like

I dont get it. What are you trying to achieve.
Are you trying to achieve this animation state?
image
I put your script up for testing and it seems to work fine.


(it changes into running animation!)

1 Like

can i see your script, because mine is not working

1 Like

the only difference(maybe) is that i have a different running animation, which i took from the player’s “Animate” script, in run i put an id, that should work

1 Like

i copied your default code! Hmmm, can you send me a video of your problem. Maybe we can figure it out more

1 Like

i have no idea how to do a video, but i maybe could explain it better. basically i’m using the animate script form the player when you join the game, then put it in startercharacterscripts
image

this is the animate script

what im trying to achieve is the running animation, like you explained above, your video is showing what im trying to achieve, idk if you had just normal walking before, but i’m trying to make the running animation play after you press one of the shift buttons, when you release it goes back to walking animation, im not the best explainer, but hopefully we could go off this

1 Like

So you used the custom animations for the default animations?
Theres either 2 things:

  1. the animation didnt load: that maybe because that the animation has failed to load
  2. it still doesnt work: it might have a problem on the animation or the animate.
1 Like

would anything show in the output for number 1?

1 Like