Contents

GKSphereObstacle

A spherical impassable volume to be avoided by agents.

Declaration

class GKSphereObstacle

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 spherical obstacle.

To learn more about using goals and agents, see Agents, Goals, and Behaviors in GameplayKit Programming Guide.

Topics

Creating an Obstacle

Placing an Obstacle

See Also

Obstacles