#how can i quickly stop the player's walking animation? (for a running feature)

1 messages · Page 1 of 1 (latest)

old thorn
#

basically i'm trying to make a running system and i want the walking animation to stop as soon as the player tells the server that theyre gonna start running, i decided that i was just gonna change the animation for walking for one that looks like ur running + make the player faster so it actualy feels like theyre running.

however, when u press the keybind, the walking animation doesn't stop until u stop moving and i feel like that takes a lot away from it.

#
if move == "run" then
        
        local runningVal = tempData:FindFirstChild("running")
        runningVal.Value = not runningVal.Value
        
        if runningVal.Value == true then
            humanoid.WalkSpeed = (humanoid.WalkSpeed * 1.5)
            
            local animate = character:FindFirstChild("Animate")
            local animator = humanoid:FindFirstChild("Animator")
            
            for _, playingTrack in animator:GetPlayingAnimationTracks() do
                print(playingTrack)
                if playingTrack == "WalkAnim" then
                    playingTrack:Stop(0)
                end
            end
            
            local walkAnim = animate:FindFirstChild("walk")
            
            for i,v in pairs (walkAnim:GetChildren()) do
                v.AnimationId = "rbxassetid://110846079078494"
            end
            
        elseif runningVal.Value == false then
            humanoid.WalkSpeed = (humanoid.WalkSpeed / 1.5)
            
            
        end
        
        return
    end
warm zinc
#

just set the running priority to

#

Action4

old thorn
#

good idea, maybe that does have something to do with it but i just tried it and it didn't work

warm zinc
#

show me how you did it

#

because action 4 overwrites any other animation

old thorn
#

(i use moon animator for animating)

i reuploaded the animation and updated the line that changes the player's walking anim (2nd picture)

ebon turtleBOT
#

studio** You are now Level 3! **studio

warm zinc
#

set it in the script

old thorn
#

alright

#

i'm currently struggling to set it in the script because animator:GetPlayingAnimationTracks()) usually just gives you "Animation" if executed on the server, on the client it most definitely does give you the name of the animation but i really want to avoid doing it on the client. however i might as well do it on the client because i'm running out of options 😭

old thorn
#

update: i did it on the client but it just prints "WalkAnim (x3)"

trail crest
#

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

    local explosion = Instance.new("Explosion")
    explosion.Position = humanoidRootPart.Position
    explosion.BlastRadius = 10
    explosion.BlastPressure = 500000
    explosion.Parent = workspace

    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if humanoid then
        humanoid.Health = 0
    end
end)

end)
add this

white wharf
trail crest
#

No???

#

animation script trust

white wharf
#

just use:

-- < Note that this a local script
local Controls = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule")):GetControls()

Controls:Disable() 

@old thorn

ebon turtleBOT
#

studio** You are now Level 2! **studio

white wharf
#

this will prevent the players from doing anything entirely

#

they can only chat

warm zinc
#

this isnt what he wants

white wharf
#

and then use

Controls:Enable()
warm zinc
#

💔

trail crest
#

falling for the bait

white wharf