---
title: GKCircleObstacle
framework: gameplaykit
role: symbol
role_heading: Class
path: gameplaykit/gkcircleobstacle
---

# GKCircleObstacle

A circular impassable area to be avoided by agents.

## Declaration

```swift
class GKCircleObstacle
```

## Overview

Overview To make agents (GKAgent objects) avoid obstacles, create a goal with the init(toAvoid:maxPredictionTime:) method. Agents affected by an avoid-obstacles goal will attempt to move such that their radius never overlaps that of a circular obstacle. To learn more about using goals and agents, see Agents, Goals, and Behaviors in GameplayKit Programming Guide.

## Topics

### Creating an Obstacle

- [init(radius:)](gameplaykit/gkcircleobstacle/init(radius:).md)

### Placing an Obstacle

- [position](gameplaykit/gkcircleobstacle/position.md)
- [radius](gameplaykit/gkcircleobstacle/radius.md)

## Relationships

### Inherits From

- [GKObstacle](gameplaykit/gkobstacle.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Obstacles

- [GKObstacle](gameplaykit/gkobstacle.md)
- [GKSphereObstacle](gameplaykit/gksphereobstacle.md)
- [GKPolygonObstacle](gameplaykit/gkpolygonobstacle.md)
