Creates a goal whose effect is to move an agent toward the current position of the specified other agent.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
An agent whose position affected agents will attempt to move toward.
A new goal object.
This goal is similar to one produced by the
goal method with a
max parameter of zero. Affected agents will attempt to move toward the target agent, but without taking the target’s movement into account.
You can also use this goal when you want an agent to move toward a target point, such as the current mouse or touch location. Create another agent that remains stationary at the target point (that is, has no velocity and no goals), and use that agent as the parameter when creating a goal with this method.