Instance Method


Removes the specified obstacle from the graph.


func removeObstacles(_ obstacles: [GKPolygonObstacle])



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


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

See Also

Working with Obstacles

var obstacles: [GKPolygonObstacle]

The list of obstacle objects in the graph, each of which describes a polygon-shaped impassable area.

func addObstacles([GKPolygonObstacle])

Adds new obstacles to the graph.