Pathfinding Service Bug

Pathfinding Service unable to create a path on smooth terrain.

In-game and in Studio the pathfinding bug occurs. This bug is presented when I attempt to create a path using two parts and it goes over smooth terrain.

It’s not cost-related to my knowledge and has been reproduced by various other developers I know.

This happens 100% of the time for me, and others have this issue too.

Code for command bar:

local Pathfinding = require(game.ServerScriptService.Services.PathfindingService)

local waypoints = Pathfinding.CalculatePath(game.Selection:Get()[1].Position, game.Selection:Get()[2].Position, 100):GetWaypoints()

if workspace:FindFirstChild("MessAround") then
	workspace.MessAround:Destroy()
end
Instance.new("Folder", workspace).Name = "MessAround"

for i,waypoint in ipairs(waypoints) do
	local part = Instance.new("Part", workspace.MessAround)
	part.Material = Enum.Material.Neon
	part.Anchored = true
	part.Position = waypoint.Position
	part.Archivable = false
	local v = (255 / #waypoints) * i
	part.Color = Color3.fromRGB(v, v, 255)
	part.Size = Vector3.new(0.5,0.5,0.5)
end

PathfindingService.lua (Services Folder)

local PathfindingService = game:GetService("PathfindingService")

local module = {}

--[=[
    @method CalculatePath
    @within PathfindingService
    @server

    Uses roblox's PathfindingService to calculate a path for AI Cars to follow to go from point A to B. 

    @param start Vector3 -- The initial point the vehicle will move from
    @param destination Vector3 -- The point the vehicle will end at
    @param DangerNumber number -- The higher, the more likely it is to follow road rules. 
    @return Path | nil -- The path class will be returned.
]=]

module.CalculatePath = function(start: Vector3, destination: Vector3, DangerNumber: number)
	
	local path = PathfindingService:CreatePath({
		Costs = {
			--DangerZone = DangerNumber,
			Grass = math.huge,
			LeafyGrass = math.huge,
			Concrete = math.huge,
			Plastic = 4
		},
		AgentCanJump = true,
		AgentCanClimb = true,
		WaypointSpacing = 100,
		AgentHeight = 5,
		AgentRadius = 5
	})

	path:ComputeAsync(start, destination)

	if path.Status == Enum.PathStatus.Success then
		return path
	end
	
	print(path)
end


return module

Steps to Reproduce:

  1. Create two parts.
  2. Run the command bar code, you’ll need to create the Pathservice module OR combine it within your code.
  3. It’ll generate a path for non-terrain based paths, for smooth terrain it’ll error as no path is produced.

This is usually if terrain is elevated, however instances of flat terrain have occurred aswell.

This error occurs with or without Costs in the experience.

Evidence

This is what is generated from an experience I am a developer on:

Without Terrain


With Terrain

Another example that was errored

Many thanks.

4 Likes

Bumping this up, any update on this bug?

1 Like

This bug is now affecting some games I know of, that don’t even use terrain.


No errors in console, nothing. Just completely broken.

3 Likes

my game that im developing just had its pathfinding completely stop working because of this and i never even touched the pathfinding code

1 Like

Thanks for the report! We’ll follow up when we have an update for you.

1 Like

@M_etrics Don’t mark the above comment as a solution as the report will get auto-locked in 14 days.

@M_etrics Please un-mark this post as a solution, it isn’t a solution and we don’t need the post to get locked in 2 weeks while this is still unresolved!

@thirdtakeonit Do you have an update on this? A serious issue with high dependency on pathfinding in many big games who trust ROBLOX to uphold it’s functionality - as a consequence I have had to recode my way of going about pathfinding, or systems similar to it. Kind regards.

Do you have a repro place with that portion of the terrain that fails?

In Studio Edit mode, with the debug visualization enabled, do you see the the navmesh generated for that region?

It is extremely random but I can confirm that portion fails and am happy to create one for you using that portion of terrain.


Red line is the route it should follow.

Bumping for you, any update on this bug?

Apologies for the late reply.

We identified a problem in how pathfinding processes the new terrain, and anticipate deploying a fix in next week’s release.

I cannot confirm that it will resolve your specific issue since I don’t have a way to reproduce it, but I will keep you updated once the fix is released so that you can test it yourself.

3 Likes

Thank you so much @portenio, keep me posted and I will attempt to reproduce upon the live fix being pushed out.

Additionally, while I have your attention - will this website bug be followed up through the appropriate team? Configuration of Passes not visible within Group Audit Logs.

1 Like

Yesterday we’ve successfully deployed an update that should have fixed this issue. If you’re still experiencing any problems, let us know.

Thanks again for your report and feedback!

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