Returns the weight for the specified goal’s influence on agents.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
A goal already included in the behavior’s set of goals.
The weight to be applied to the goal’s influence on an agent’s speed and direction, or
0 if the goal is not in the behavior.
When an agent evaluates its behavior, it examines each goal and calculates the change in direction and speed necessary to move toward fulfilling that goal (within the limits of the current time step and the agent’s maximum speed and turn rate). The agent then combines these influences to determine the total change in direction and speed for the current time step. Weights modulate the effects of multiple goals in a behavior.