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

How do I make the PathfindingService work with larger objects?

Asked by 9 years ago

Hi, I just got into the PathfindingService and I can't seem to figure out how to make the path that's generated account for object size, and currently, my objects get stuck around corners and narrow hallways.

I'm using this script from the Wiki(modified a little):

game.ReplicatedStorage.RemoteFunction.OnServerInvoke = function(player, target)
    local start = player.Character.Torso.Position
    local path = pathfindingService:ComputeSmoothPathAsync(start, target, 500)

    if path.Status == Enum.PathStatus.FailStartNotEmpty or path.Status == Enum.PathStatus.FailFinishNotEmpty then
        print("Compute failed")
        return {}
    end

    return path:GetPointCoordinates()       
end

How would I go about implementing it?

Answer this question