Contents

init(goal:weight:)

Creates a behavior with a single goal.

Declaration

convenience init(goal: GKGoal, weight: Float)

Parameters

  • goal:

    A goal object.

  • weight:

    A weight to be applied to the goal’s influence on an agent’s speed and direction.

Return Value

A new behavior object. To assign a set of goals to an agent, use its behavior property.

Discussion

For more information, see GameplayKit Programming Guide.

See Also

Creating a Behavior