Contents

GKPath

A polygonal path that can be followed by an agent.

Declaration

class GKPath

Overview

To make an agent move to or stay within the area defined by a path, create a goal with the init(toStayOn:maxPredictionTime:) method; to make an agent traverse along a path, create a goal with the init(toFollow:maxPredictionTime:forward:) method.

A path can be expressed as a sequence of either 2D points or 3D points. Use the former to create paths for use by GKAgent2D objects, and the latter to create paths for GKAgent3D objects to follow.

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

Topics

Creating a Path

Managing a Path’s Attributes

Inspecting a Path’s Shape

Initializers

See Also

Agents, Goals, and Behaviors