Garry's Mod Wiki

NPC:IsInViewCone

  boolean NPC:IsInViewCone( Vector position )
  boolean NPC:IsInViewCone( Entity ent )

Recently Added

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

Description

Tests whether a position or an NPC is in the view cone of the NPC.

Default Arguments

1 Vector position
The position to test.

Argument Overload: Entity input

1 Entity ent
The entity to test. Will use the entity's position.

Returns

1 boolean
If the given position is in the view cone.