#how do I make a run animation play when running

1 messages · Page 1 of 1 (latest)

twin compass
#

here's the script btw:

#
local UserInputService = game:GetService("UserInputService")
local animation = ("UwalkAnim")

local function onInputStarted(inputObject, processedEvent)
    if processedEvent then return end
    
    if inputObject.KeyCode == Enum.KeyCode.LeftShift then
        local character = Players.LocalPlayer.Character
        if not character then return end
        
        local humanoid = character:FindFirstChildOfClass("Humanoid")
        if not humanoid then return end
        
        local animator = humanoid:FindFirstChildOfClass("Animator")
        if not animator then return end
        
        humanoid.WalkSpeed = 20
        animator:LoadAnimation(animation):Play(133873410833807)
    end
end

local function onInputEnded(inputObject, processedEvent)
    if processedEvent then return end

    if inputObject.KeyCode == Enum.KeyCode.LeftShift then
        local character = Players.LocalPlayer.Character
        if not character then return end

        local humanoid = character:FindFirstChildOfClass("Humanoid")
        if not humanoid then return end
        
        local animator = humanoid:FindFirstChildOfClass("Animator")
        if not animator then return end

        humanoid.WalkSpeed = 12
    end
end

UserInputService.InputBegan:Connect(onInputStarted)

UserInputService.InputEnded:Connect(onInputEnded)```
fervent wedge
#

playtest

#

go into your character

#

somewhere there will be an “animate” script. copy that put it in startercharacterscripts

#

replace the animation ids in the object and script

#

and boom

#

done

twin compass
#

I did that for the walkanim but the walkanim and runanim in the animate thing is basically the same, you only usually see an actual walkanim if you slow-walk on mobile

fervent wedge
#

are you trying to make your own run anim?

twin compass
#

??