RichAI + Recast Graph, the character can only pathfind on one "color" of mesh

I’ve generated a Recast Graph for a model of a house that contains doors that can be opened or closed in-game, but that are all closed in the editor. These doors present a problem though, in that the generated recast graph appears to have several different meshes that are all drawn with a different color in the scene viewer, and when a RichAI script is applied to my character it is unable to find a way to leave the “Green” area in the foyer in order to explore the “Pink” area behind the door to the basement, even when no obstructions or colliders are in the way. There seems to be no way for the meshes to connect to each other such that a path can be generated between them.

Is it such that I must remove or place all my doors on a different layer before generating the Recast Graph if I want a graph that makes the house traverseable in its entirety?

HI

The different colors indicate different connected components of the graph (i.e a group of nodes for which there is a walkable path to any other node in the area), the characters can by definition not move from one area to another.

You will need to move your doors to another layer if you want the recast graph to ignore them.

That does indeed resolve the problem. It might be good for me to move the doors into a separate GameObject so that the entire object and all its children can be placed on a separate RecastIgnore layer when the graph needs to be generated and then returned to its original layer afterwards, so that the game’s logic doesn’t have to make special allowances at runtime for an editor-only layer.

1 Like