---
title: "removeObstacles(_:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gkobstaclegraph/removeobstacles(_:)"
---

# removeObstacles(_:)

Removes the specified obstacle from the graph.

## Declaration

```swift
func removeObstacles(_ obstacles: [GKPolygonObstacle])
```

## Parameters

- `obstacles`: An array of obstacle objects to be removed from the graph.

## Discussion

Discussion After removing obstacles, the GKObstacleGraph class automatically creates, removes, or rearranges nodes and edges where necessary to describe the navigable area around the complete collection of obstacles.

## See Also

### Working with Obstacles

- [obstacles](gameplaykit/gkobstaclegraph/obstacles.md)
- [addObstacles(_:)](gameplaykit/gkobstaclegraph/addobstacles(_:).md)
- [removeAllObstacles()](gameplaykit/gkobstaclegraph/removeallobstacles().md)
- [nodes(for:)](gameplaykit/gkobstaclegraph/nodes(for:).md)
