What do you want to achieve? Im trying to make a basic ai that follows a block using pathfinding.
What is the issue? The pathfinding waypoints are returning an empty table.
What solutions have you tried so far? I’ve looked at other post and youtube videos and still getting nothing.
--
local HumanoidRootPart = script.Parent.HumanoidRootPart
local Humanoid = script.Parent.Humanoid
local PathFindingService = game:GetService("PathfindingService")
local function WalkTo(Target)
local Path = PathFindingService:CreatePath()
Path:ComputeAsync(HumanoidRootPart.Position,Target.Position)
local WayPoints = Path:GetWaypoints()
print(WayPoints)
for i,v in pairs(WayPoints) do
Humanoid:MoveTo(Target.Position)
end
end
WalkTo(workspace.Target)
Is the Path not blocked? If the path is blocked then it will likely return an empty table (though, I myself have not looked into this before so I’m not entirely sure)