-
Pathfinding agent ignoring Costs
-
After setting the material costs in my pathfinding script the agent seems to ignore them completly and takes his own path
-
I tried setting the cost to 1000 but it didn’t help. And setting plastic to math.Huge but that didn’t do anything
This is my code:
pathService = game:GetService("PathfindingService")
local RunService = game:GetService("RunService")
local finish = game.Workspace.BegginerTable.npcWalkUp
local human = script.Parent:WaitForChild("Humanoid")
local torso = script.Parent:WaitForChild("HumanoidRootPart")
local path = pathService:CreatePath({
Costs = {
Concrete = 1000,
--Plastic = math.huge
}
})
path:ComputeAsync(torso.Position, finish.Position)
local waypoints = path:GetWaypoints()
for i, waypoint in pairs(waypoints) do
human:MoveTo(waypoint.Position)
human.MoveToFinished:Wait()
end
human:MoveTo(finish.Position)
Thanks!