#NPC Animation being weird..

1 messages · Page 1 of 1 (latest)

scenic cedar
#

My NPC Animation is playing but it's stopping long before it should ?? Idk how to fix it

`local humanoid = script.Parent.Humanoid

local anim = script.Animation

local track = humanoid:LoadAnimation(anim)

track.Looped = true

while task.wait(1) do
track:Play(0)
end`

hollow warren
#

You're basically playing the animation from start every 1s through that while loop.

#

That's why

scenic cedar
#

So what should I change the 1 to ?

hollow warren
#

Uhm

#

Do this:

#

Just remove the while loop

#

If the animation is set to looped, it shouldn't be necessary

#

unless there's another reason

scenic cedar
#

so just

#

`local humanoid = script.Parent.Humanoid

local anim = script.Animation

local track = humanoid:LoadAnimation(anim)

track.Looped = true

`

red timber
#

just do

local anim = script.Parent.Humanoid.Animator:LoadAnimation(script.Animation)

anim:Play()
anim.Looped=true

#

put an animator inside of the humanoid