I have a part in the way of the rig and the endpart, but it doesn’t go the waypoints. I haven’t found any working solutions on the devforum, so I really need help.
This is my script so far:
local pathfindingservice = game:GetService("PathfindingService")
local humanoid = script.Parent:WaitForChild("Humanoid")
local torso = script.Parent:WaitForChild("Torso")
local path = pathfindingservice:CreatePath()
path:ComputeAsync(torso.Position, game.Workspace.EndPart.Position)
local waypoints = path:GetWaypoints()
for i, waypoint in pairs(waypoints) do
humanoid:MoveTo(waypoint.Position)
print(i, waypoint)
end
humanoid:MoveTo(game.Workspace.EndPart.Position)
This actually did return some values though:
16:45:54.986 1 {-0.0525512695, 0, -43.1014404}, Walk, Plastic - Server - Pathfinding:11
16:45:54.986 2 {3.78816104, 0, -41.9838867}, Walk, Plastic - Server - Pathfinding:11
16:45:54.990 3 {7.62887335, 0, -40.866333}, Walk, Plastic - Server - Pathfinding:11
16:45:54.990 4 {11.4695854, 0, -39.7487793}, Walk, Plastic - Server - Pathfinding:11
16:45:54.990 5 {15.310298, 0, -38.6312256}, Walk, Plastic - Server - Pathfinding:11
16:45:54.990 6 {19.1510105, 0, -37.5136681}, Walk, Plastic - Server - Pathfinding:11
16:45:54.991 7 {22.9917221, 0, -36.3961143}, Walk, Plastic - Server - Pathfinding:11
16:45:54.991 8 {26.8324337, 0, -35.2785568}, Walk, Plastic - Server - Pathfinding:11
16:45:54.991 9 {28.2180843, 0, -34.8753662}, Walk, Plastic - Server - Pathfinding:11
16:45:54.991 10 {28.4146557, 0, -30.8801994}, Walk, Plastic - Server - Pathfinding:11
16:45:54.991 11 {28.4309025, 0, -30.5499821}, Walk, Plastic - Server - Pathfinding:11
16:45:54.991 12 {25.90942, 0.0833150521, -27.4462414}, Walk, Plastic - Server - Pathfinding:11
16:45:54.991 13 {23.3879795, 0.180593848, -24.3425541}, Walk, Plastic - Server - Pathfinding:11
16:45:54.992 14 {20.866539, 0.277872652, -21.2388649}, Walk, Plastic - Server - Pathfinding:11
16:45:54.992 15 {18.3451004, 0.375151426, -18.1351776}, Walk, Plastic - Server - Pathfinding:11
16:45:54.992 16 {16.0343018, 0.464303493, -15.2907715}, Walk, Plastic - Server - Pathfinding:11
Any help would be greatly appreciated!