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)
Any help?
1 Like
Pathinl
(Pathinl)
June 16, 2023, 6:39pm
#2
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
Pathinl
(Pathinl)
June 16, 2023, 6:52pm
#4
Then, how do you call the PlayAnimation function? (gonna need see code)
Look at the original post, its there
Pathinl
(Pathinl)
June 16, 2023, 6:56pm
#6
I mean how is it being called (once or looping)
it gets called once when sprinting
Pathinl
(Pathinl)
June 16, 2023, 6:58pm
#8
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
Pathinl
(Pathinl)
June 16, 2023, 7:08pm
#10
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.