Table of Contents

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 Vector3

Target position to move to

distanceThreshold float

How 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.

Move while attacking any enemies encountered:
Hero.GoToAnd(targetPosition, 2, () => Hero.AttackNearestEnemy(3));