Garry's Mod Wiki

ENTITY:TranslateNavGoal

  Vector ENTITY:TranslateNavGoal( Entity enemy = GetEnemy(), Vector currentGoal = GetEnemyLastKnownPos() )
  Vector ENTITY:TranslateNavGoal( Entity target, Vector currentGoal )

Recently Added

This was recently added in version (2024.12.12). It might only be available on the Dev Branch right now.

Description

Called by the engine to alter NPC's final position to reach its enemy or target.

This hook only exists for ai type SENTs.

Default Arguments

1 Entity enemy = GetEnemy()
The enemy being chased.
2 Vector currentGoal = GetEnemyLastKnownPos()
The enemy's chase position.

Argument Overload: Moving to target

1 Entity target
The path_corner in query.
2 Vector currentGoal
path_corner's origin.

Returns

1 Vector
The actual point that NPC will move to reach its enemy or target. For the path to get updated, the new move path must be away from the current NPC:GetGoalPos by 120 units.

Do not return anything to not override.