Quick answer: Call “Regenerate obstacle map” after placing or moving obstacles. Without it, the Pathfinding behavior uses a stale grid and either finds no path or finds a path that ignores obstacles. Also check that the cell size is small enough to detect your obstacles and that Max Nodes is high enough for your layout.

Here is how to fix Construct 3 Pathfinding not finding a route. You added the Pathfinding behavior to your enemy sprite, set up walls with the Solid behavior, called “Find path,” and the enemy does not move. The “On path found” condition never triggers. Instead, “On failed to find path” fires every time, even when there is a clear open path between the enemy and the target. The setup looks correct, but the pathfinder disagrees.

The Symptom

You call the “Find path” action on an object with the Pathfinding behavior. The “On failed to find path” condition triggers immediately. The object does not move. In some cases, the path is found but the object walks through walls as if the obstacles do not exist. In other cases, the path works for stationary obstacles but fails when obstacles are created or moved at runtime.

The problem is intermittent in some layouts — short paths succeed but long paths fail, or paths work in open areas but fail in maze-like levels.

What Causes This

1. Obstacles not regenerated. The Pathfinding behavior builds an internal grid map of walkable and blocked cells at the start of the layout. If you create, destroy, or move obstacle objects after the initial load, the grid is stale. The pathfinder thinks walls exist where they do not, or that passages are open when they are blocked.

2. Cell size too large. The cell size (default 20 pixels) determines the grid resolution. If your wall sprites are narrower than the cell size, a wall might fall entirely within a single cell and be recognized, or it might straddle two cells and be missed. Narrow corridors smaller than the cell size may be marked as blocked entirely.

3. Max Nodes too low. The pathfinder explores grid cells using an A* algorithm with a node limit. When the layout is large, the number of cells to explore can exceed this limit. The pathfinder gives up and reports failure even when a path exists — it just could not explore enough of the grid to find it.

4. Obstacle objects not marked as obstacles. Only objects with specific behaviors (Solid, or manually added to the obstacle list) are recognized by the pathfinder. If your wall sprites do not have the Solid behavior (or are not added as pathfinding obstacles), the pathfinder does not see them at all.

The Fix

Step 1: Regenerate obstacles after layout changes. In your event sheet, add a “Regenerate obstacle map” action after any event that creates, destroys, or moves obstacles. This rebuilds the internal grid:

// Event sheet (shown as pseudocode)

// On start of layout:
//   Pathfinding > Regenerate obstacle map
//   (Wait for "On obstacle map regenerated" before pathfinding)

// After creating a wall:
//   System > Create object Wall at (x, y)
//   Pathfinding > Regenerate obstacle map

// After destroying a wall:
//   Wall > Destroy
//   Pathfinding > Regenerate obstacle map

// IMPORTANT: Wait for regeneration to complete
// On obstacle map regenerated:
//   Enemy > Find path to (target.X, target.Y)

Step 2: Adjust the cell size. Select the object with the Pathfinding behavior. In its properties, set Cell Size to match or be smaller than your smallest obstacle or corridor. For a game with 32-pixel-wide walls and 64-pixel-wide corridors, use a cell size of 16:

// Pathfinding behavior properties:
// Cell size: 16   (must be smaller than narrowest obstacle)
// Cell border: 0  (extra blocked border around obstacles)
// Max nodes: 5000 (increase for large levels)
// Diagonals: Enabled (set to your preference)

Step 3: Increase Max Nodes for large layouts. Calculate the approximate grid size: (layout width / cell size) * (layout height / cell size). Set Max Nodes to at least this value. For a 3200x2400 layout with cell size 16, the grid is 200x150 = 30,000 cells. Set Max Nodes to 30000 or higher:

// For a 3200 x 2400 layout with 16px cells:
// Grid = 200 x 150 = 30,000 cells
// Set Max Nodes >= 30,000
// Higher values use more CPU per pathfind but find longer paths

Step 4: Verify obstacle registration. Ensure every wall or obstacle object has the Solid behavior. Without it, the Pathfinding behavior does not recognize the object as an obstacle. Alternatively, use “Add obstacle” on the Pathfinding behavior to manually register object types as obstacles even without the Solid behavior.

“The pathfinding grid is a snapshot, not a live view. Every time the world changes, you must tell the pathfinder to rebuild its grid. It does not watch for changes automatically.”

Why This Works

Construct 3’s Pathfinding behavior uses an A* search on a grid that is generated from the current positions of obstacle objects. This grid is a cached snapshot — it is computed once and reused for all pathfinding queries until you regenerate it. This design is a performance optimization: rebuilding the grid is expensive, so the engine does not do it automatically every frame. But it means the developer must manually trigger regeneration whenever the obstacle layout changes. Missing this step is the number-one cause of pathfinding failures.

The cell size determines how the continuous game world maps to the discrete grid. Obstacles are rasterized onto the grid — any cell that overlaps an obstacle is marked as blocked. If the cell size is larger than an obstacle, the obstacle may not cover any cell center and could be missed entirely. Smaller cells capture fine detail but increase the grid size quadratically, requiring more Max Nodes for long paths.

Related Issues

If pathfinding works but the object’s movement is jerky or the object clips through corners, adjust the Cell Border property. A border of 1 or 2 cells around obstacles gives the pathfinder padding, producing smoother paths that do not hug walls.

If the pathfinding regeneration causes a frame hitch on large layouts, split obstacles into regions and regenerate only the affected region. Alternatively, regenerate asynchronously and wait for “On obstacle map regenerated” before issuing pathfinding queries.

Regenerate after every obstacle change. Shrink the cell size. Raise Max Nodes. Check for Solid behavior.