Animation wont work

Hello, my animation wont work.
i followed a yt tutorial and tried to make my own script of it.

here is my code.

local NpcHumanoid = script.Parent
local NPC = NpcHumanoid.Parent
local RaftBlock = game.Workspace.RaftBlock
local Animator = NpcHumanoid.Animator

function oogway()
	local chosenPOS = RaftBlock.Position
	NpcHumanoid:MoveTo(RaftBlock.Position)
end

wait()
oogway()

while oogway() do
	NpcHumanoid:PlayAnimation().ID = 11609305632
end

Not sure what this is about, but you should be playing animations via using the LoadAnimation() function provided by the Animator object, you also have to check & make sure that your AnimationPriority is set to the correct type as well, cause ROBLOX recently changed their Animation Engine where there’s now 4 more additional Action priorities

local NpcHumanoid = script.Parent
local NPC = NpcHumanoid.Parent
local RaftBlock = game.Workspace.RaftBlock
local Animator = NpcHumanoid.Animator

function oogway()
	local chosenPOS = RaftBlock.Position
	NpcHumanoid:MoveTo(RaftBlock.Position)
end

task.wait()

oogway()

while oogway() do
    local Anim = Animator:LoadAnimation(AnimationObjectHere)
    Anim:Play()
end

create animation object, parent it to npc humanoid
image

insert your animation id here
image
do

local Anim = script:WaitForChild("Anim")
local AnimTrack = humanoid.Animator:LoadAnimation(holdAnim)

holdAnimTrack:Play()

here code:

local NpcHumanoid = script.Parent
local NPC = NpcHumanoid.Parent
local RaftBlock = game.Workspace.RaftBlock
local Animator = NpcHumanoid.Animator
local Anim = NpcHumanoid:WaitForChild("Animation") -- here
local AnimTrack = Animator:LoadAnimation(Anim) -- here

function oogway()
	local chosenPOS = RaftBlock.Position
	NpcHumanoid:MoveTo(RaftBlock.Position)
end

wait()
oogway()

while oogway() do
    AnimTrack:Play() -- here
end

i put the priority to movement. and code does not work.

local NpcHumanoid = script.Parent
local NPC = NpcHumanoid.Parent
local RaftBlock = game.Workspace.RaftBlock
local Animator = NpcHumanoid.Animator

function oogway()
	local chosenPOS = RaftBlock.Position
	NpcHumanoid:MoveTo(RaftBlock.Position)
end

task.wait()

oogway()

while oogway() do
	local Anim = Animator:LoadAnimation(Animator)
	Anim:Play()
end

check my post above -----------

alright, where do i put

??? --------------------------

i already do this, check the code

But now my dummy wont move at all.

did you put Animation in correct place?

i put it in humanoid. ----------

OH, one error, wait ----------

local Anim = NpcHumanoid:WaitForChild("Animation") -- new
replace it

Make sure to check your Output for any potential errors that you may have missed, cause another thing that seems odd to me is that you’re calling a function within a loop (Which I don’t know why you could just use while true do) & we’re trying to figure out your scenario

while true do
	local Anim = Animator:LoadAnimation(AnimationObjectHere)
	Anim:Play()
    task.wait(1)
end

it said something of the lines

Unknown. dummy.humanoid.animatelocal

you updated local Anim line?
it should be

local Anim = NpcHumanoid:WaitForChild(“Animation”)