Issue with roblox default animation script

So im modifying the roblox animate script to support my sprinting system. Problem is the PlayAnimation function doesnt work for the sprint for some odd reason. Any help?
This is how its supposed to be and works for walk anim

PlayAnimation("walk", 0.1, Humanoid)

Here is mine that doesnt work for some reason:

		PlayAnimation("sprint",0.3,Humanoid)


image
Any help?

1 Like

Maybe remove the “rbxassetid://” part like the other ids on the list

1 Like

Nope, it didn’t work. It still just plays the walk anim even when sprinting

Then, how do you call the PlayAnimation function? (gonna need see code)

Look at the original post, its there

I mean how is it being called (once or looping)

it gets called once when sprinting

then it gets overwritten by the wait(0.1) loop in the animation script, modify it to play sprint animation when sprinting and walk when not

No… the numbers are the transition time for the animation to smoothly transition into position

Im about this wait loop in the end of the default animation script, it plays stepAnimate 0.1 second:

while Character.Parent ~= nil do
    local _, currentGameTime = wait(0.1)
	stepAnimate(currentGameTime)
end

then find

elseif (pose == "Running") then
   playAnimation("walk", 0.1, Humanoid)

and change to

elseif (pose == "Running") then
   if Sprinting then
      PlayAnimation("sprint",0.3,Humanoid)
   else
      playAnimation("walk", 0.1, Humanoid)
   end

and change the Sprinting value whenever ur sprinting

It kinda works, it stutters quite often tho.