Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

AI ignores pathfinding path?

Asked by 4 years ago

I'm trying to make it so the player can give an AI a certain area to go, and the AI will use pathfinding to get there. But for some reason, the AI outright ignores the path and tries to get to the last point possible.

Snippet:

local Path = game:GetService("PathfindingService")
                local Async = Path:FindPathAsync(v.HumanoidRootPart.Position,script.Pos.Value)

                if Async.Status == Enum.PathStatus.Success then
                for i,p in pairs(Async:GetWaypoints()) do
                    print(p.Position)
                    local part = Instance.new("Part",workspace)
                    v.Humanoid:MoveTo(p.Position)
                    if p.Action == Enum.PathWaypointAction.Jump then
                        v.Humanoid.Jump = true
                        end
                    end
                end
0
Nevermind... I figured out the problem, I just need to wait until they got to the next point. CaptainAlien132 225 — 4y

Answer this question