Contents

init(goals:)

Creates a behavior with the specified goals.

Declaration

convenience init(goals: [GKGoal])

Parameters

  • goals:

    An array of goal objects.

Return Value

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

Discussion

The new behavior contains the specified goals, each with a weight of 1.0. To change a goal’s weight after creating the behavior, keep a reference to that goal and use the setWeight(_:for:) method.

See Also

Creating a Behavior