Class

GKObstacle

The abstract base class for objects representing impassable areas in a game world.

Declaration

@interface GKObstacle : NSObject

Overview

You do not use this class directly; instead, create instances of its concrete subclasses GKCircleObstacle, GKSphereObstacle, and GKPolygonObstacle. To make agents (GKAgent objects) avoid obstacles, create a goal with the goalToAvoidObstacles:timeBeforeCollisionToAvoid: method.

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

Relationships

Inherits From

See Also

Obstacles

GKCircleObstacle

A circular impassable area to be avoided by agents.

GKSphereObstacle

A spherical impassable volume to be avoided by agents.

GKPolygonObstacle

A polygon-shaped impassable area in a 2D game world.