How to stop jitter during transition between two animations

Hello!

I’m having an issue where one animation briefly seems to glitch out a bit before playing the next.

Here’s what I mean:

Like you can see in the video, my NPC does a bit of a turn and shakes a bit before going into his walk animation. I’m not sure if the animation is just not stopping properly, or if it’s something else.

Here’s the script for the animations:

local NPC = game.Workspace.TestNPC
local Humanoid = NPC.Humanoid


local TurnAnim = script.TurnAnim
local TurnAnimTrack = Humanoid:LoadAnimation(TurnAnim)

TurnAnimTrack.Looped = false

local WalkAnim = script.WalkAnim
local WalkAnimTrack = Humanoid:LoadAnimation(WalkAnim)

wait(4)
TurnAnimTrack:Play()
TurnAnimTrack.Stopped:Wait()
WalkAnimTrack:Play()
Humanoid:MoveTo(game.Workspace.Part.Position)

Any help is greatly appreciated. Thank you in advance!

Maybe try to set the turn animation to action?

check you animation to see if there is any playbacks/loops

use an extra task.wait after. so that it waits a second or so longer.

1 Like

That does seem to fix the jitter issue, however now a gap comes up where my NPC goes back to its starting state.

Is there a way that I can stop the animation on its last frame without removing it from the character? I’m somewhat new to animating and the technical side of it, so I don’t really know what I’m doing haha.

I see the issue, please ensure that the animation doesnt have loop enabled.
Also feel free to dm me on discord for faster and better responces, kieranl29_#3816