-- We use the built-in PathfindingService. See https://wiki.roblox.com/index.php?title=API:Class/PathfindingService

local PathfindingService = game:GetService("PathfindingService")
local DEBUG = false

local Pathfinder = {}
Pathfinder.__index = Pathfinder

function Pathfinder.new(RootPart)
	assert(RootPart and RootPart:IsA("BasePart"), "Pathfinder.new(RootPart) requires a valid BasePart!")
	local Data = {
		CurrentPath = nil,
		RootPart = RootPart,
		Target = nil,
		_DrawnPath = nil
	}
	return setmetatable(Data, Pathfinder)
end
