How to know occupied nodes?

I’m working on a tetris game, after placing blocks into the grid, I want to check the nodes that the block has occupied. Currently, I’m using a 2-dimensional array to check which node is occupied in the grid, is there a better solution?

Hi

If you know the grid coordinates you can use:

var graph = AstarPath.active.gridGraph;
if (graph.GetNode(x, y).Walkable) {
   // Walkable node
} else {
   // A wall!
}