Running the default R15 Walk animation on an NPC with an Animator

being the lazy person I am, I decided to pull out the regular R15 walk animation instead of making one. apparently it isn’t as simple as looping, because the default character animation script uses something like this:

function AnimationHandler:_HandleRBXTrack(anim: Animation)
	print("call")
	local track = self._Animator:LoadAnimation(anim)
	track.KeyframeReached:Connect(function(kf: string)
		if kf == "End" then
			track:Destroy()
			self:_HandleRBXTrack(anim)
		end
	end)
	track.Stopped:Connect(function() print("stopped") end)
	track:Play()
end

I tried this, but when I call Track:Stop() it doesn’t stop. the weirdest part is that the handler writes “stopped,” and the console stops writing “call,” yet it keeps going. even destroying the track inside of the Stopped handler doesn’t work. on the other hand if I delete the stuff inside the KeyFrameReached handler it doesn’t loop at all. so uh, what’s up?

I am not using a humanoid so I can’t use HumanoidDescriptions.

1 Like

I have absolutely no idea what is going on, but is the animation is already playing, make sure not to play it again.