I'm trying to set up a ctrl to run system where the player animation changes when the player is and is not running. I got the script for this working, but the animation for running doesn't change until the player either jumps or idles. How do I make the animation update when the player is running?
Script:
function startPlayerRunning(player)
if players[player].Vitals.Stamina-1 > 0 then
players[player].Vitals.Stamina = players[player].Vitals.Stamina-1
runningCharacters[player] = true
player.Character.Humanoid.WalkSpeed = runSpeed
player.Character.Animate.run.RunAnim.AnimationId = sprintRunAnim
end
end
startRunning.OnServerEvent:Connect(startPlayerRunning)
function stopPlayerRunning(player)
runningCharacters[player] = false
player.Character.Humanoid.WalkSpeed = defaultSpeed
player.Character.Animate.run.RunAnim.AnimationId = defaultRunAnim
end
stopRunning.OnServerEvent:Connect(stopPlayerRunning)
Gif of issue: https://gyazo.com/a568e571dc4473999ac12f0313c40437

4 comments
I already got userinputservice done client side. I tried loading an animation like that, but the animation speed was too slow and looked clunky after you jumped or something
Read my edit please!
I got those already as well. I got everything set up. I just need the core running animation to not stutter. Please see the gif I edited onto my question of the issue where the animation doesn't change right away.
oh