Unwanted teleporting when playing animation

Hello. As the title suggests whilst I play an animation (in this case a running animation) my character teleports precisely -340282346638528859811704183484516925440 studs in the Y axis, I’m not even exaggerating. But why?

There are no bugs at all in the code, all I’m doing is juggling between 3 animations using adjust weight, but only for the part there I adjust both the speed and weight of the running animation does my character teleport to a stupid range!

ForwardWalkAnimation:AdjustSpeed(ForwardAnimationWeight >= 0 and 1 or -1)
ForwardWalkAnimation:AdjustWeight(math.min(1, MovementVelocity.Magnitude/6) * math.abs(ForwardAnimationWeight), .1)
		
RightWalkAnimation:AdjustWeight(math.min(1, MovementVelocity.Magnitude/6) * RightAnimationWeight, .1)
		
LeftWalkAnimation:AdjustWeight(math.min(1, MovementVelocity.Magnitude/6) * LeftAnimationWeight, .1)

-- Beneath this line is the issue causing this weird glitch

RunAnimation:AdjustSpeed(MovementVelocity.Magnitude/5.5/1.99)
RunAnimation:AdjustWeight(math.max(0, (MovementVelocity.Magnitude/6 - 2)/2+.5),.1)

So is this the animation itself that’s causing it? I have no idea, so what do you think the problem is?

Try not to pass 0 or a negative weight value in :AdjustWeight and see if it goes away.

You can do something like math.clamp(weight, 0.01, 10) or by setting your math.max(0, …) to math.max(0.01, …).