Pathfinding Service doesn't work when Y axis is higher than 0

For some reason, whenever I use pathfinding service, when the destination position on the Y axis is higher than 0, my script breaks. Output is empty. Sorry If i’m asking a stupid question, I just forgot how to use it.

My script:

local pfs = game:GetService("PathfindingService")
local NPC = script.Parent
local Destination = workspace:WaitForChild("Destination")
local path = pfs:CreatePath({
    ['AgentCanJump'] = true,
})

path:ComputeAsync(Npc.HumanoidRootPart.Position,Destination.Position)

for i,v in pairs(path:GetWaypoints()) do 
    if v.Action == Enum.PathWaypoint.Action.Jump then
        NPC.Humanoid.Jump = true
    end
    local animation = NPC.Humanoid:LoadAnimatoin(script.Animation)
    NPC.Humanoid:MoveTo(v.Position)
    animation:Play()
    NPC.Humanoid.MoveToFinished:Wait()
    animation:Stop()
end

Thanks for the help!

Not sure why it’s doing that but this it’s LoadAnimation. I’m surprised it didn’t give you errors

Sorry, I had to type out the whole script into devforum so I made typos ( I was scripting on a dif device )

Found the problem, forgot to set the Agent Height. XD

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.