Get the current state of AI||doc135567

September 20, 2022

Format

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

Description

Get the current state of the entity AI.


Value Returned

type Description
state state class


Code Samples

on the entity object servermount scriptIn each frame, the current state of the entity AI is obtained and printed

local control = this:getAIControl()
World.Timer(1, function()
    local curState = control:getCurState()
    --Status name, auto-exit time
    print(curState.NAME, curState.endTime)
    return true
end)


--local _entity = curState:getEntity()
--local _control = curState.control