Method GoToAnd
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
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
position
Vector3Target position to move to
distanceThreshold
floatHow close to get to the position
action
Func<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));