Game Logic: getCurrentController

getCurrentController()
  • Returns the controller logic brick that this python script is attached to.

Return Type:

  • SCA_PythonController
Sample Code

################## get the Controller the logic brick is attached to
 
# import bge

import bge

# get the current controller
cont = bge.logic.getCurrentController()