---
title: vertexCount
framework: gameplaykit
role: symbol
role_heading: Instance Property
path: gameplaykit/gkpolygonobstacle/vertexcount
---

# vertexCount

The number of vertices that define the polygon-shaped area of the obstacle.

## Declaration

```swift
var vertexCount: Int { get }
```

## Discussion

Discussion Obstacles are immutable objects; to change the shape of an obstacle, remove it and create a new obstacle with a new list of vertices. Use this property along with the vertex(at:) method to inspect an existing obstacle—for example, to draw a debugging overlay representing the obstacle in your game.

## See Also

### Inspecting Vertices

- [vertex(at:)](gameplaykit/gkpolygonobstacle/vertex(at:).md)
