Type Method

behaviorWithGoal:weight:

Creates a behavior with a single goal.

Declaration

+ (instancetype)behaviorWithGoal:(GKGoal *)goal weight:(float)weight;

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.

See Also

Creating a Behavior

+ behaviorWithGoals:

Creates a behavior with the specified goals.

+ behaviorWithGoals:andWeights:

Creates a behavior with the specified goals and weights.

+ behaviorWithWeightedGoals:

Creates a behavior with the specified mapping of goals to their weights.