Slide animation mixing with default run animation

Hi, so i’ve made a Slide animation for my character. It’s priority is Action, and it is looped. The problem is that when i play it in game it mixes with the run animation, which is not what i want. The Run animation’s priority is Core. I’ve tried adding this block of code:

		for _, track in ipairs(Humanoid:GetPlayingAnimationTracks()) do
				if track ~= Anims.Skid then
					track:Stop(0.1)
				end
			end

It does work, but if you stop sliding while you are still running, the run animation won’t play anymore until the character stops moving and then starts moving again. I’ve also tried setting the Slide Animation’s priority to Action4, but still nothing. Any help with this?

1 Like

the issue is mainly because your slide is stopping the run animation, but there’s nothing telling it to restart right after. the engine only re-triggers the run anim when the movement state changes — so if the player’s already moving, it just doesn’t bother.

one easy fix is to check if the player is still moving after the slide ends, and then manually play the run anim again. you can do something like:

if humanoid.MoveDirection.Magnitude > 0 then
   humanoid:LoadAnimation(RunAnim):Play()
end

just put that after you stop the slide animation or when the slide ends. also make sure your run anim isn’t looped weird or getting replaced — sometimes it gets stuck if priorities get messy. action4 is fine but honestly priority isn’t the core problem here, it’s just about cleanly restarting what you need after the slide ends.

Thanks, but where exactly do i put the code? The “RunAnim” is part of the default ROBLOX Animate script, not the moveset/slide script. I used it and simply replaced the animation IDs.

1 Like

since you’re using the default Animate script setup, the Run animation is being handled internally by that script, not manually through your slide code. So when you stop all tracks (like in your track:Stop() loop), the Animate script isn’t aware that it needs to restart Run, unless the movement state changes like you said.

One easy way around this without rewriting a bunch of Animate logic is: after your slide ends and you’ve stopped the slide anim, just check if the player’s still moving, and then fire off the Run animation manually using the same setup Animate uses. You can get the track like this:

local runTrack = humanoid:LoadAnimation(Animate.run.RunAnim)
runTrack:Play()

Stick that right after the slide stops. So it would look like:

Anims.Skid:Stop()
if humanoid.MoveDirection.Magnitude > 0 then
	local runTrack = humanoid:LoadAnimation(Animate.run.RunAnim)
	runTrack:Play()
end

It’s not the cleanest thing in the world because it’s poking into the Animate script’s stuff from the outside, but it works fine for this case. You could also consider making a little function to handle resetting the movement anims so you’re not duplicating stuff.

Another option, if you wanna stay clean and future-proof, would be to hook into the Animate script directly and add logic for stopping and restarting anims properly in there — but honestly for quick fixes, that code above should be enough.