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!