Animation AdjustTrack only half works

I’ve got an animation that plays whenever the player holds LeftShift to sprint, and I’m adjusting the track speed to 0 so that it can stay in the animation frame I want, but it only works half the time and only if I’m really holding LeftShift. I don’t know a thing about AdjustTrack. Help?

Part of the code

UIS.InputBegan:connect(function(key, gameProcessed) 
	
	if not (Tool.Parent == Character) then
		return
	end
	
	if IsCrouching.Value == true or IsHealing.Value == true or IsAiming.Value == true or IsReloading.Value == true
		or IsAimFiring.Value == true or IsHipFiring.Value == true then 
		return
	end
	
	if key.KeyCode == Enum.KeyCode.LeftShift then
		
		script.Parent.Values:WaitForChild("IsSprintAnim").Value = true
		
		SprintingAnimation:Play()
		wait(0.2)
		SprintingAnimation:AdjustSpeed(0)
		
		print("Sprinting")
		
	end
end)

UIS.InputEnded:connect(function(key, gameProcessed)

	if key.KeyCode == Enum.KeyCode.LeftShift then
		
		script.Parent.Values:WaitForChild("IsSprintAnim").Value = false
		
		SprintingAnimation:AdjustSpeed(-1)
		wait(0.2)
		SprintingAnimation:Stop()
		
		print("Stopped Sprinting")
		
		end
end)
2 Likes

Oops, I just had to adjust the time lol

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.