I’ve looked around and still haven’t found a solution to this. If you know what the issue is lmk.
local function walkTo(where)
local success, errorMessage = pcall(function()
path:ComputeAsync(model.PrimaryPart.Position, where)
end)
if success and path.Status == Enum.PathStatus.Success then
for _, waypoint in path:GetWaypoints() do
humanoid:MoveTo(waypoint.Position)
humanoid.MoveToFinished:Wait()
end
end
end
local function findNearest()
local nearest = nil
for _, obj in pairs(game.Players:GetPlayers()) do
local char = obj.Character
if not nearest then nearest = obj end
if (model.HumanoidRootPart.Position - char.HumanoidRootPart.Position).Magnitude <= (model.HumanoidRootPart.Position - nearest.Character.HumanoidRootPart.Position).Magnitude then
nearest = obj
end
end
return nearest
end
while true do
rs.Heartbeat:Wait()
walkTo(findNearest().Character.HumanoidRootPart.Position)
model.HumanoidRootPart.breath:Play()
end
And people say to remove humanoid.MoveToFinished:Wait()
but if i do the pathfinding would just start acting like humanoid:MoveTo()
, running into walls and not acting like pathfinding at all.