Instance Method


Returns the weight associated with the goal specified by subscript syntax.


- (NSNumber *)objectForKeyedSubscript:(GKGoal *)goal;



A goal already included in the behavior’s set of goals.

Return Value

The weight to be applied to the goal’s influence on an agent’s speed and direction, or 0.0 if the goal is not in the behavior.


This method is equivalent to the weightForGoal: method, but allows access using subscript syntax.

See Also

Working with Goals Using Subscript Syntax

- setObject:forKeyedSubscript:

Sets the weight for the goal specified by subscript syntax.

- objectAtIndexedSubscript:

Returns the goal at the specified index in the behavior’s list of goals.