---
title: "init(radius:)"
framework: gameplaykit
role: symbol
role_heading: Initializer
path: "gameplaykit/gksphereobstacle/init(radius:)"
---

# init(radius:)

Initializes a spherical obstacle with the specified radius.

## Declaration

```swift
init(radius: Float)
```

## Parameters

- `radius`: The radius for the new obstacle.

## Return Value

Return Value A spherical obstacle.

## Discussion

Discussion To make agents avoid the obstacle, create a goal with the goalToAvoidObstacles:timeBeforeCollisionToAvoid: method.
