Character running animation doesn't stop when using track:Stop()

For some reason the default running animation track doesn’t stop when using track:Stop() despite track:Stop() working for other animations.

Happens when you anchor the player while they’re moving and their animation keeps playing.

for _, track in animator:GetPlayingAnimationTracks() do				
	track:Stop()
end

I’ve also tried it with the humanoid instead of the animator, and it changed nothing.
I’ve set the WalkSpeed to 0 too and it changed nothing.

try instead of looping in all animations just get animation and play it

I was able to replicate this issue, and I suspect that it’s happening due to the network ownership of the player’s character changing to the server when they’re anchored

I tried stopping the AnimationTracks on the server-side (I also tried stopping them both on the client-side and the server-side), but the run animation continued to play

The only solution I found is to prevent the character from moving by setting their Humanoid’s WalkSpeed and JumpHeight to 0, instead of anchoring them


@TriumphRBX

Oddly enough, it doesn’t work if you do so in a LocalScript, as the run animation would also continue to play (I don’t know why this is happening, though)

Using a server script fixed the issue for me :slight_smile::+1:

This is the exact script I used to test:

-- server script in serverscriptservice
local Players = game:GetService("Players")


local function onPlayerAdded(player: Player)
	player.CharacterAppearanceLoaded:Wait()
	task.wait(4) -- to give me time to start walking

	player.Character.Humanoid.WalkSpeed = 0
	player.Character.Humanoid.JumpHeight = 0

	local animator = player.Character.Humanoid.Animator:: Animator

	for _, track in animator:GetPlayingAnimationTracks() do
		track:Stop()
	end

	print("tracks should be stopped now")
end

Players.PlayerAdded:Connect(onPlayerAdded)