Animation Glitching

(im going to try to keep this as simple as possible)

so basically i have a Custom Version of the Player Module which basically makes you movement smoother.
HOWEVER, that custom version also messes with Walk Animation IF your walk animations is played using hum.Running:Connect(function(speed) which mine is.

video of what it looks like


example of how im playing my walk animation

hum.Running:Connect(function(speed)
	if speed > 1 then
		IdleAnim:Stop(.5)
		WalkAnim:Play()
	else
		IdleAnim:Play(.5)
		WalkAnim:Stop()
	end
end)

and the PlayerModule im using:

(THE ONLY THING YOU SHOULD LOOK AT IS PlayerModule → ControlModule, because thats whats edited)

1 Like

Your animations are overlapping. hum.Running is fired every time that the humanoid’s speed changes, and therefore every time your character’s speed is changed, your animations replay.
I HEAVILY recommend using the default roblox “Animate” script and replacing the IDs. This is a local or server script which can be found in the character whilst playing the game.
Here is a tutorial on how to get and use it: Roblox Scripting Tutorial: How to Script Custom Animations - YouTube

i actually did do this and it fixed it, but the reason im trying to play the anims using the event is so i can change them whenever i want, for example thje players health is low so i can change it

your prob gonna say “just change the id” well that barely works and only updates when the characters moves and stuff

Use the IsPlaying property of AnimationTracks.

hum.Running:Connect(function(speed)
	if speed > 1 then
		IdleAnim:Stop(.5)
		if WalkAnim.IsPlaying == false then
           WalkAnim:Play()
        end
	else
		if IdleAnim.IsPlaying == false then
           IdleAnim:Play(.5)
        end
		WalkAnim:Stop()
	end
end)

Nonono! You can do that exactly and theres a simple solution:
image

Use this function in the animate script to stop all of the animations and then replay them, like I did here for one of my games:
image

It always helps to understand the script before giving up.

1 Like

Text edition if you have trouble

if value == true and pose == "Running" or value == true and pose == "Walking" then
		stopAllAnimations()
		wait(0.1)
	playAnimation("walk", 0.1, Humanoid)
end
if value == false and pose == "Running" or value == false and pose == "Walking" then
		stopAllAnimations()
		wait(0.1)
	playAnimation("walk", 0.1, Humanoid)
	end
end)

this topic is basically useless to me now as i used a different method but thanks anyway (i edited the Animate script)