Garry's Mod Wiki

NPC:NavSetGoal

  boolean NPC:NavSetGoal( Vector pos, number length, Vector dir )

Description

Picks random node around given vector, around specified length, using dir as search direction start. Works similarly to NPC:NavSetRandomGoal, but you can decide any position you want as a search starting point rather than your NPC.

Arguments

1 Vector pos
The origin to calculate a path from.
2 number length
The target length of the path to calculate.
3 Vector dir
The direction in which to look for a new path end goal.

Returns

1 boolean
Whether path generation was successful or not.