Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to make my custom run animation play?

Asked by 3 years ago

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

0
Note: i am using a custom animate script instead of the default roblox one proROBLOXkiller5 112 — 3y
0
just use roblox default one its way easier YOURATlol 0 — 3y
0
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 proROBLOXkiller5 112 — 3y
0
i want to actually understand the code that im reading or writing proROBLOXkiller5 112 — 3y

Answer this question