<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKMeshGraph/removeObstacles(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKMeshGraph(im)removeObstacles:"
  },
  "title" : "removeObstacles(_:)"
}
-->

# removeObstacles(_:)

Removes the specified obstacle from the graph.

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

## Parameters

`obstacles`

An array of obstacle objects to be removed from the graph.

## Discussion

Adding or removing obstacles does not update the graph. The [`GKMeshGraph`](/documentation/GameplayKit/GKMeshGraph) class adds, removes, and arranges nodes to describe the navigable areas around obstacles *only* when you call the [`triangulate()`](/documentation/GameplayKit/GKMeshGraph/triangulate()) method. Typically, you add or remove several obstacles, then call the [`triangulate()`](/documentation/GameplayKit/GKMeshGraph/triangulate()) method to update the graph.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)