Pathfinding isn't trying to get past walls

You can write your topic however you want, but you need to answer these questions:

  1. I want to achieve a simple pathfinding system for an npc

  2. It only walks into walls and jumps when your in a higher plane

  3. I’ve searched Far but I haven’t been able to find a good solution

 local function CreatePath(Part, Chaser)
	
	
	
	Chaser.HumanoidRootPart:SetNetworkOwner(nil)
	
	
	local success, errorMessage = pcall(function()
		Path:ComputeAsync(Chaser.PrimaryPart.Position, Part.PrimaryPart.Position)
	end)
	
	return Path
end


local function MoveToPart(Part, Chaser)
	local Path = CreatePath(Part, Chaser)
	
	
	if Path.Status == Enum.PathStatus.Success then
		for _, waypoint in pairs(Path:GetWaypoints()) do
			Chaser.Humanoid:MoveTo(waypoint.Position)

			if waypoint.Action == Enum.PathWaypointAction.Jump then
				Chaser.Humanoid.Jump = true
			end

		end
	end
	
	
end

it uses a while task.wait() loop for it, I know it isn’t the best but I have found no solutions for this

1 Like

at Chaser.Humanoid:MoveTo(waypoint.Position) , do

Chaser.Humanoid:MoveTo(waypoint.Position)
Chaser.Humanoid.MoveToFinished:Wait()

it goes through a set of waypoints but doesn’t change it when you move, I’ve tried this

you’d have to explain in detail for a better response

I struggle to explain it sorry, but It moves a set of waypoints and waits until its completed moving to all of those waypoints ( the movetofinished ) before updating the path

Is your world meshes or parts? Try PathfindingModifiers, AgentParameters, refining your code

I’ve tried agent parameters, I dont know about pathfinding modifiers, ill try it out

I dont really see how it could help, I’ve watched the videos but sorting paths isn’t the problem, I dont know how I can refine my code

( only 1 year of experience )