[Solved] Pathfinding Problem

Are there any errors in the Output?

There are 0 errors in the Output

(character limit)

You didn’t change any of the code, right?

Add some code underneath this:

-- Create our Path with SimplePath
local path = require(script.SimplePath).new(stranger, pathParams)

path.Error:Connect(function(ErrorType)
    warn(`Could not pathfind: {ErrorType}`)
end)

Check the Output when you get to the same issue with the new code.

1 Like

Computation Errors

Change your attack function:

local function attack(target)
	local distance = (rootPart.Position - target.HumanoidRootPart.Position).Magnitude
	
	if distance > 3 then
		local targetPosition = target.HumanoidRootPart.Position
		
		local success = path:Run(targetPosition)
		
		if not success then
			humanoid:MoveTo(targetPosition)
		end
	else
		target.Humanoid.Health = 0
	end
end

I’m not entirely sure what could be causing it, but this should at least mean the NPC won’t freeze in it’s tracks if something goes wrong.

oh I know exactly what is causing it lol. I was just curious if you knew already. Roblox’s horrific navigational mesh systems not making any sense? Yup. That’s exactly it as always. :joy:

Navigational mesh trolling us so hard that this union has invisible parts connected to it(that came from nothing since the original didn’t have this whatsoever), despite the fact the actual shape of the union is completely different.

Yeah :face_with_diagonal_mouth: Does changing the CollisionFidelity change anything?

1 Like

Yes that was the solution. FINALLY. I had to switch it from Default to PreciseConvexDecomposition. Completely removed the excess parts. Thank you so much. I can finally use simple path on a 3D map!! Yayy

1 Like

Glad to have helped :laughing: One last thing, when you set the CollisionFidelity back to what it was at where the Navigation Mesh was broken, is there actually any invisible collision where it says there is, on the sides next to the walls?

1 Like

None whatsoever. It doesn’t just fix the pathfinding, it removes the distortion from the union

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.