Pathfinding wont compute the path correctly

Im making a pathfinding AI and it works alright for the main part, but for some reason when i go upstairs the npc stops computing the path correctly.


while wait() do
		local Path = PS:CreatePath({AgentRadius = 3.25,AgentCanJump = true})

		Path:ComputeAsync(hrp.Position, thiefRoot.Position)
		local waypoints = Path:GetWaypoints()
		
		print(1)
		
		if npc.LocatedThief.Value == true then
			for i,waypoint in pairs(waypoints) do
				
				print(2)
				if i == 2 then
					
					print(3)

					hum:MoveTo(waypoint.Position)
					wait(.15)
				end
			end
		end
end

The npc.LocatedThief value is not the issue, as the green cube on screen indicates that the value is true
I am really unexperienced with pathfinding so i have no idea what the problem might be.

try making the stairs not collide, and having an invisible ramp that follows the same general angle, also if the stairway isn’t more than 6.5 studs wide, it’ll fail anyway

3 Likes

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