Table of Contents

Method GoToAndAttack

Namespace
GrindFest
Assembly
GrindFest.dll

GoToAndAttack(Vector3, float)

Moves to a position while attacking any enemies that come within range.

public GoToResult GoToAndAttack(Vector3 position, float distanceThreshold = 2)

Parameters

position Vector3

Target position to move to

distanceThreshold float

How close to get to the position

Returns

GoToResult

GoToResult indicating movement status

Remarks

This is a convenience method that combines GoToAnd with AttackNearestEnemy. The hero will stop to attack enemies that are within 3 units while moving.

Move to position while fighting:
while (GoToAndAttack(dungeonEntrance) != GoToResult.Reached)
{
    if (Health < MaxHealth * 0.3f)
    {
        DrinkHealthPotion();
        RunAwayFromNearestEnemy();
    }
}