NPC keeps on moving when dead?

Hello!

I wanna wonder why my NPC keeps on moving when its dead.
(There is a animate script inside of the NPC.)

I can’t figure out how to make it stop moving when its dead, so i neep help.

There is an animation when the npc dies, so may that be it? I dont know. Here is a video of what i am trying to say:

robloxapp-20220928-1423061.wmv (1.7 MB)

Here is the script that plays the animation when the NPC dies. (on the server-side)

local Character = script.Parent
local Humanoid = Character:WaitForChild('Humanoid')

local Anim = script.Animation
local Animation = Humanoid.Animator:LoadAnimation(Anim)

Humanoid.HealthChanged:Connect(function(Health)
	
	if Health < 0.1 and not Animation.IsPlaying then
		
		Animation:Play()
		

		
	end
end)

Some of my questions are down below.:

Does this have to do with the Humanoid’s Properties?
Would this mess have to do with something inside of the Character?
Could it be the Animate script that is inside of the NPC?

Help is appreciated, thank you.

To make it stop: Animation:Stop()

This is not what i am talking about at all.
I want the animation to continue playing, i just dont want the NPC to be wiggling around and stuff which is shown in the video.

Try anchoring the HumanoidRootPart.

1 Like

Worked, thank you! Sorry for the long topic.