Some multiple areas in 1 Grid Graph working others blocked

I am in the process of making a top-down 2d game using the A* pathfinding it was working but now I have 4 separate ‘areas’ of the only Grid graph in the scene, if I try use my ‘collider’ tiles to section a new area off (like the other 3 working areas are) it just fills the area with ‘unwalkable’ blocked off red? is there a limit to how many areas can be in one Grid Graph? I couldn’t find any setting other than min area size which is at 0… any help would be appreciated! <3

Hi

Unwalkable nodes are indicated by a red cube. Each (walkable) area will have a different color (one of those colors are reddish). Check Settings -> Colors -> Custom Area Colors.
If it does not work, could you post a screenshot?

As you can see with the picture the single GridGraph has mulitple areas because of the ‘blocked’ tiles, however the area to the right is exactly the same tiles surrounding what should be a new ‘area’ but it has decided that the entire inside of the area is blocked… What could be causing this? the setup of the tiles is identical for all of those areas

Hm… That’s really odd if it is configured the same way.
Are you sure they don’t have a different collider or something? Or are in a different layer?
What happens if you simply copy one of the regions to the left and move it to the right?

The ‘rock’ tiles are on the layer ‘blocked’ which is what the GridGraph is using as its collision detection, the ‘sand’ tiles are not actually recognized (so basically the GridGraph isn’t ‘detecting’ a ground, it is just walkable on any area which isn’t ‘blocked’ layer) I copy and pasted the rock layered tiles like you said and it still makes the entire inside area ‘unwalkable’ it is really baffling me!

if I remove one of the ‘blocked’ rock tiles from the surround it does make it walkable via the single unblocked node though…

I originally thought there might be some kind of set limit to how many sub-areas a GridGraph could have but I could not find any discernible setting or description that would state that being the case.

I have a script that loads a prefab at run-time that once the GridGraph is updated the new prefabs become new areas that are walkable!
So it is technically working for that, however any new area I try to create in the editor by placing the ‘blocked’ tiles are still unwalkable even once the game is running and even after an update of the GridGraph… it must be some kind of oddity I have somehow tripped up on, I might have to try recreating the whole tilemap and see if it still keeps happening

I meant that you should move all tiles, including the sand ones.

So if that rock was placed there the whole region inside the rocks became unwalkable??

To clarify, there is no such limit.

Yeah the whole area becomes unwalkable and I have tried copying the sand as well it still doesn’t make an area (the sand isn’t even apart of the GridGraph’s detection)

I didn’t think there would be such a limit thanks for clarifying :slight_smile:

Puzzling that the original 3 areas I made work and so do the new areas that are created at run-time, yet nothing I do can make a new area in the editor with placing any new ‘blocked’ tiles.

Thanks for helping me try to figure this out, I felt like I was going crazy that I missed something but I think I’ve just found a obscure bug of some kind :’(

(I’ll try updating unity and keep trying to figure this out)

Yeah I really have no idea what could be causing that.
There aren’t any colliders or triggers generated by whatever you use to build the tilemap, right?
Try to select all objects in the scene to check if there are any colliders that you have missed.

Yeah the tilemap system I am using basically has each tile have its own box collider attached to the ‘child object tile’ which uses its parents layer (being ‘blocked’ for GridGraph to be detecting) so the only tile that has a box collider on it is the rock and its on its own tilemap separate from any other tilemap. I’m updating Unity and will try to remake the tilemap GameObject and even the GridGraph to see if I can replicate or find a fix.

I found the problem! it is caused by the tilemap system!

the tilemap system is making gameobject children as ‘chunks’ for its collision data if they chunk covers an entire region of the ‘blocked’ tiles it deems it as an entire collision area… however if the middle of a region is 2 separate chunks it will allow the pathfinding to create the area inside! I will try to find a fix for this and I’ll post the answer.

Actually on further inspection the chunk is using a Polygon Collider but it is using a box for the entire inside of that chunk region on the right so therefor it is indeed blocking the GridGraph, this was obviously an oversight and I will contact the tilemap asset developer for a fix.

Thanks tons for your help Aron!

Hi

Awesome that you managed to figure it out :slight_smile:
Yeah I had a feeling there were some extra colliders generated somewhere.