Check that rect area is walkable

Is it possible to check if a rect area is completely walkable?

Sometimes I need to spawn an object, and I must ensure that it spawns on the walkable area and not inside of the walls. Using the classic way to get the nearest node and snap to it works fine for when the object is definitely inside of the wall. But often I just want to spawn the object on a walkable continuous playfield without snapping.


You can use GridGraph.GetNodesInRegion(bounds) and then iterate through the nodes and check that they are walkable.
See Documentation

1 Like