Animations cause glitching in humanoids movement

Hello members of devforum,
I have been working on a movement script for a cat, and I have troubles getting it to walk in a straight line, without “jittering”.

Video of problem:
robloxapp-20211206-1906484.wmv (2.4 MB)

Script:

Explorer:
RobloxExplorer

As you can see in the video, when the cat moves towards the character, it strafes a little bit. I think this problem is due to the walk animation. I have tried setting the network ownership to the player. There is no error in the output. I want to know how I can fix this glitching. If you need anymore information just ask. Thank you in advance!

Have you tried while task.wait() do instead of heartbeat? You might get the same result however.

I will try that, thank you! charrssssss

If you want the animation to run smoothly its best to load it from the server and then play it from the client.

I tried this and I think there is no difference unfortunately

I just tried this and the same strafing occurs with playing the animation on the client