Player walking in place

Hello Developers!

I have an issue and that being sometimes when the player is done walking, my walking animation doesn’t stop and you are still walking in place. It usually happens after jumping.

So far I couldn’t find any resources for help so that’s why I’m here!

Here’s my script:

local walkAnimationId = "rbxassetid://17452287404"
local jumpAnimationId = "rbxassetid://17460497483"
local fallAnimationId = "rbxassetid://17365776917"
local idleAnimationId = "rbxassetid://17478322113"
local idle2AnimationId = "rbxassetid://17465043717"
local toolAnimationId = "rbxassetid://14319554342"
local climbAnimationId = "rbxassetid://17384195192"


local players = game:GetService("Players")

local function onCharacterAdded(character)
	local humanoid = character:WaitForChild("Humanoid")

	local animateScript = character:WaitForChild("Animate")

	animateScript.walk.WalkAnim.AnimationId = walkAnimationId
	animateScript.jump.JumpAnim.AnimationId = jumpAnimationId
	animateScript.fall.FallAnim.AnimationId = fallAnimationId
	animateScript.idle.Animation1.AnimationId = idleAnimationId
	animateScript.idle.Animation2.AnimationId = idle2AnimationId
	animateScript.toolnone.ToolNoneAnim.AnimationId = toolAnimationId
	animateScript.climb.ClimbAnim.AnimationId = climbAnimationId
end

local function onPlayerAdded(player)
	player.CharacterAppearanceLoaded:Connect(onCharacterAdded)

end

players.PlayerAdded:Connect(onPlayerAdded)

PS: I barely know anything about scripting.

Any help?

2 Likes

Maybe try manually putting the animation ids into the Default roblox Animate script.

2 Likes

Sadly, that did not fix the problem.

1 Like

Something weird I found is that Roblox’s classic animations have this issue too

Its just THOSE animations actually DO stop in place.

1 Like

try to replace your script with this and see if it works

local walkAnimationId = "rbxassetid://17452287404"
local jumpAnimationId = "rbxassetid://17460497483"
local fallAnimationId = "rbxassetid://17365776917"
local idleAnimationId = "rbxassetid://17478322113"
local idle2AnimationId = "rbxassetid://17465043717"
local toolAnimationId = "rbxassetid://14319554342"
local climbAnimationId = "rbxassetid://17384195192"


local players = game:GetService("Players")

local function onCharacterAdded(character)
	local humanoid = character:WaitForChild("Humanoid")

	local animateScript = character:WaitForChild("Animate")

	animateScript.walk.WalkAnim.AnimationId = walkAnimationId
	animateScript.jump.JumpAnim.AnimationId = jumpAnimationId
	animateScript.fall.FallAnim.AnimationId = fallAnimationId
	animateScript.idle.Animation1.AnimationId = idleAnimationId
	animateScript.idle.Animation2.AnimationId = idle2AnimationId
	animateScript.toolnone.ToolNoneAnim.AnimationId = toolAnimationId
	animateScript.climb.ClimbAnim.AnimationId = climbAnimationId

    humanoid.Running:Connect(function()
        local moving = (humanoid.MoveDirection.Magnitude > 0)
        local walking_anim = animateScript.walk.WalkAnim
        if (moving and walking_anim.Playing) then 
            walking_anim:Stop()
        end
    end)
end

local function onPlayerAdded(player)
	player.CharacterAppearanceLoaded:Connect(onCharacterAdded)

end

players.PlayerAdded:Connect(onPlayerAdded)
1 Like

For some reason it still doesn’t work. Not that there is an error and the script wont work but I am still having the same issue as before, the animation still plays. (The script is a normal script in ServerScriptService by the way)

1 Like

When you make all these changes, try doing:

player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Landed)

I did a zombie transformer commission in the past where I had to touch a part and a player would become a zombie. They would also animate into a zombie.

If I ran over the part the animations would break.

You could insert this line before or after the changes. Or you could check whenver the player lands and automatically make the player idle.

1 Like

Replace the “if speed > 0.01” check in the animate script to “if speed > 0.1” or “0.25”. (It’s on line 355). I tried it and it works for me.

1 Like

I tried changing the values on the animate script but it still didn’t work.

I placed the animate script inside on StarterCharacterScripts after taking it from the players humanoid. Did I do anything wrong?

1 Like

Did you cut the animate script from the player and then paste it back into startercharacterscripts? Here’s what I mean by this


(after your reply) did you edit this line too?

1 Like

Exactly that, yes.

Need more characters

1 Like

(After edit:) Yes. Although, may game has a walkspeed of 30 and jump power of 65, is that the issue?