Pathfinding now working

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

1 Like

The node is indicating to jump to get over the wall. You can fix this by making the wall bigger, or by adjusting the agent parameters:

local agentParams = {
	AgentRadius = 2.0,
	AgentHeight = 5.0,
	AgentCanJump = false -- set this to false
}
 
local path = PathfindingService:CreatePath(agentParams)
4 Likes

Many thanks, man. It worked like a charm. Cheers !

2 Likes