Get whether the AI can see the entity||doc135583

September 20, 2022

Format

 AIControl:canSeeEnemy(enemy)
  • The class to which the function belongs:AIControl

Description

Gets whether an entity is within the AI's field of view.


Parameters

type Description
Entity entity


Value Returned

type Description
bool true, the AI can see the entity. false, the AI cannot see the entity.

Code Samples

local player
local petEntity
local control = petEntity:getAIControl()
local canSeePlayer = control:canSeeEnemy(player)