Method GoToAnd
GoToAnd(Vector3, float, Func<bool>)
Moves to a position while performing an action.
public static GoToResult GoToAnd(Vector3 position, float distanceThreshold, Func<bool> action)
Parameters
positionVector3Target position to move to
distanceThresholdfloatHow close to get to the position
actionFunc<bool>Action to perform while moving. If action returns true, movement stops.
Returns
- GoToResult
GoToResult indicating movement status
Remarks
This method is useful for combining movement with other activities like attacking enemies or picking up items along the way.
Hero.GoToAnd(targetPosition, 2, () => Hero.AttackNearestEnemy(3));