I heard Roblox was fixing their horrible pathfinding system so i decided to try it out, why is radius being so weird…??
local Humanoid = script.Parent:WaitForChild("Humanoid")
local HumanoidRootPart = script.Parent:WaitForChild("HumanoidRootPart")
local PathfindingService = game:GetService("PathfindingService")
local path = PathfindingService:CreatePath({
AgentRadius = 20,
AgentHeight = 5,
AgentCanJump = true,
AgentCanClimb = true,
WaypointSpacing = 2,
Costs = {
Leather = 1
},
PathSettings = {
SupportPartialPath = false
}
})
-- Compute the path
local success, errorMessage = pcall(function()
print("hawk tuah")
path:ComputeAsync(HumanoidRootPart.Position, workspace.EndPart.Position)
end)
-- Confirm the computation was successful or it returned partial path
local waypointthing = 1
if success and (path.Status == Enum.PathStatus.Success or path.Status == Enum.PathStatus.ClosestNoPath) then
print("asd")
local WayPoints = path:GetWaypoints()
Humanoid.MoveToFinished:Connect(function(bool)
if bool and waypointthing < #WayPoints then
Humanoid:MoveTo(WayPoints[waypointthing].Position)
waypointthing +=1
end
end)
Humanoid:MoveTo(WayPoints[waypointthing].Position)
waypointthing +=1
end