Hi, I am trying to have the humanoid use the pathfinding system, to go around the obstacle and reach the goal (the red part). However, as you can see from the waypoints, it is trying to go through the obstacle, instead of goind around it and I am not sure why. The nav mesh looks ok, the obstacle is solid (CanCollide is ON). Any hints ?
local finish = game.Workspace.Finish
local PathfindingService = game:GetService(“PathfindingService”)
local human = script.Parent:WaitForChild(“Humanoid”)
local torso = script.Parent:WaitForChild(“HumanoidRootPart”)local path = PathfindingService:CreatePath({
WaypointSpacing = 1
})path:ComputeAsync(torso.Position, finish.Position)
local waypoints = path:GetWaypoints() --creates a table with the waypoints
for i,waypoint in pairs (waypoints) do
human:MoveTo(waypoint.Position)
human.MoveToFinished:Wait(2)
end