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

How do i add more points to the PathfindingService?

Asked by 4 years ago

I tried to make my pathfinding dummy climb ladders so i made a path out of parts (https://imgur.com/a/YsOpPBf) and it didnt work well. I unpacked the points and the table of the parts i have made so they can be in the same table but it still didnt work. here is a part of the code:

path = game:GetService("PathfindingService"):FindPathAsync(rootpart.Position, head.Position) points = path:GetWaypoints() local a = game.Workspace.Notes:GetChildren() local nodes = {unpack(a),unpack(points)} if path.Status == Enum.PathStatus.Success then for i, v in pairs(nodes) do human:MoveTo(v.Position) human.MoveToFinished:Wait(2)

                            if (points[#points].Position - head.Position).magnitude >15 then
                                break
                            end
                        end

the dummy is moving toward the parts i have made however, it doesnt know when to climb and it most of the times climbs even if there is a clear path and it doesnt even need to climb the part path. (https://imgur.com/a/O0z7ZBV) the NPC(green guy) is the moving AI while the red guy is a simple npc without scripts. Any help/suggestions?

Answer this question