i am very new to animation so i dont know what im doing
local IdleAnimation = script:WaitForChild("IdleAnimation")
local Humanoid = script.Parent.Humanoid
local AnimationTrack = Humanoid:LoadAnimation(IdleAnimation)
AnimationTrack:Play()
local StartupSprint = script:WaitForChild("SprintStartUp")
local SprintAnimation = script:WaitForChild("SprintAnimation")
local LoadSprintA = Humanoid:LoadAnimation(SprintAnimation)
local loadIt = Humanoid:LoadAnimation(StartupSprint)
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function()
if Humanoid.MoveDirection.X == 1 or Humanoid.MoveDirection.X == -1 then
loadIt:Play()
loadIt.Stopped:Wait()
LoadSprintA:Play()
else
LoadSprintA:Stop(2)
end
end)
i want it to play the startup animation when i start moving and when that animation ends it will play another animation
i just need my animations to play correctly in the right pattern and thats it and also i would like tips and suggestions
idk if using runservice is the right choice here but im currently just making a prototype so not everything has to be perfect

4 comments
Note: i am using a custom animate script instead of the default roblox one
just use roblox default one its way easier
i could not understand how the default one work but i do know how to make my animations play on the default one but the thing is i dont want that
i want to actually understand the code that im reading or writing