GSC reference › Built-in

CanSee()

Built-in (engine) Server AI Called on: sentient

Check to see if the AI can see the given entity.

Signature

<sentient> CanSee(<target>, [cacheLength])

Called on an entity: sentient CanSee(...)

Parameters

NameRequired?Details
targetRequired (entity) The entity to check.
cacheLengthOptional (integer) The cache length

Example (from Treyarch's docs)

if( self CanSee( player ) )

Real uses in BO3's scripts

Called 27 times in the decompiled scripts. A few, zombies first:

Related built-ins

  • SeeRecently()
    Check to see if the AI saw the given sentient in the past <time>.
  • CantSeeEntities()
    Returns the set of entities that a player cannot see within a given angle, given a set of entities
  • SetGoal()
    Set this AI 's goal.
  • ForceTeleport()
    Force Teleport the actor to a new position with the given origin and angles, regardless of wether it will be visible to the player or not.
  • OrientMode()
    Set the orient mode of this actor.
  • AnimMode()
    Set the way that animation deltas are interpreted by the game engine
  • PathMode()
    Set the path mode of this actor.
  • HasPath()
    Returns true/false if AI has a path
  • ClearForcedGoal()
    Clears the forcedGoal for this AI's goal.
  • setgoalpos()
    Set this AI 's goal.
  • UsePosition()
    Override where the actor should run to.
  • GetPerfectInfo()
    Forces the AI to become aware of this entity regardless of whether it can be seen or not.

New to GSC?

Start with the basics, or paste a compile error to get the fix.

Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).