Idle animation problem NPC

local RP = game:GetService("ReplicatedStorage")

local Humanoid = script.Parent.Humanoid
local idleAnimation = RP:WaitForChild("Animations").Idle
local animation = Humanoid.Animator:LoadAnimation(idleAnimation)

if Humanoid.MoveDirection.Magnitude == 0 then
	print("1")
	animation:Play()
	print("1.5")
elseif Humanoid.MoveDirection.Magnitude >= 1 then
	print("2")
	animation:Stop()
	print("2.5")
end

So I have a NPC, I need to make so that when he stands still he played idle animation. But for some reason, the print is written, but the animation is not played what is the problem?

That is, as if the prints work, but the animation does not.

It could be a problem with the AnimationPriority of your loaded animation. Try setting it to Idle or above if you haven’t.

Because it doesn’t make its animation have inactive animation priority, the Looped activated and also that the animation is active at all times, I don’t see the need to detect when the NPC stops

1 Like