navmesh.GetNearestNavArea

From Garry's Mod
Jump to: navigation, search
 navmesh.GetNearestNavArea( )

Contents

Description

Returns the closest CNavArea to given position at the same height, or beneath it.

Arguments

Vector pos

The position to look from

Arguments

boolean anyZ=false

This argument is ignored and has no effect

Arguments

number maxDist=10000

This is the maximum distance from the given position that the function will look for a CNavArea

Arguments

boolean checkLOS=false

If this is set to true then the function will internally do a util.TraceLine from the starting position to each potential CNavArea with a MASK_NPCSOLID_BRUSHONLY MASK_ Enums. If the trace fails then the CNavArea is ignored.

If this is set to false then the function will find the closest CNavArea through anything, including the world.

Arguments

boolean checkGround=true

If checkGround is true then this function will internally call navmesh.GetNavArea to check if there is a CNavArea directly below the position, and return it if so, before checking anywhere else.

Arguments

number team=TEAM_ANY=-2

This will internally call CNavArea:IsBlocked to check if the target CNavArea is not to be navigated by the given team. Currently this appears to do nothing.

Returns

CNavArea

The closest CNavArea found with the given parameters.
Personal tools
Navigation