# How do i create holes on NavigationRegion2D?

4.2.1

### Question

I want add holes on my NavigationRegion2D, everytime i put one building on the map i want make a hole on the building location so units will avoid the tower on pathfind, i tryd but i have no results

Here i setup the Navigation Area

``````public virtual void BuildPathfindArea(){
GD.Print(bounds.ToString());

int cellWidth = Startup.cellSize/2;
Vector2[] points = new Vector2[4];

points[0] = new Vector2(bounds.minX,bounds.minY);
points[1] = new Vector2(bounds.maxX,bounds.minY);
points[2] = new Vector2(bounds.maxX,bounds.maxY);
points[3] = new Vector2(bounds.minX,bounds.maxY);

for (int i = 0; i < points.Length;i++){
Vector2 point = points[i];
if (i == 0) {
points[i] = buildingPlacer.PlacingTilemap.MapToLocal((Vector2I)point) + new Vector2(0,-cellWidth/2);
}else if (i == 1) {
//points[i] = buildingPlacer.PlacingTilemap.MapToLocal((Vector2I)point) + new Vector2(-cellWidth,0);
points[i] = buildingPlacer.PlacingTilemap.MapToLocal((Vector2I)point) + new Vector2(cellWidth,0);
}else if (i == 2){
points[i] = buildingPlacer.PlacingTilemap.MapToLocal((Vector2I)point) + new Vector2(0,cellWidth/2);
}else{
//points[i] = buildingPlacer.PlacingTilemap.MapToLocal((Vector2I)point) + new Vector2(cellWidth,0);
points[i] = buildingPlacer.PlacingTilemap.MapToLocal((Vector2I)point) + new Vector2(-cellWidth,0);
}
}

Rid rid = pathfindRegion.GetRid();
}
``````

Here i try add the hole when one building is placed

``````public virtual void SetuptObstacle(){
Polygon2D polygon2D = new Polygon2D();

float bodyWidth = Startup.cellSize / 4 * bodySize;
float bodyHeight = bodyWidth / 2;
List<Vector2> points = new List<Vector2>();

for (float width = 0f; width < 2*Mathf.Pi; width+=2*Mathf.Pi/bodyWidth){
Vector2 point = new Vector2(bodyWidth*Mathf.Cos(width),bodyHeight*Mathf.Sin(width));

}

polygon2D.Position = Position;
polygon2D.Polygon = points.ToArray();

}
``````

Here said i could use Polygons2d Using navigation meshes — Godot Engine (latest) documentation in English that is what i did, but dont work, the Polygon is on the correctly spot / shape but still doenst work, let me show a video:

Testing

Server created regions do not auto update or have any “link” to your NavigationPolygon Resource. If you do things manually in script with the NavigationServer API you also need to do all the updates manually. After baking set the navigation polygon again for the region that you want to update with it.

you mean i need do