SCA_PythonController
Base class: SCA_IController
A Python controller uses a Python script to activate it’s actuators, based on it’s sensors.
The object the controller is attached to.
Type: KX_GameObject
script
Section titled “script”The value of this variable depends on the execution methid.
- When ‘Script’ execution mode is set this value contains the entire python script as a single string (not the script name as you might expect) which can be modified to run different scripts.
- When ‘Module’ execution mode is set this value will contain a single line string - module name and function “module.func” or “package.modile.func” where the module names are python textblocks or external scripts.
Type: string
the execution mode for this controller (read-only).
- Script: 0, Execite the
scriptas a python code. - Module: 1, Execite the
scriptas a module and function.
Type: integer
activate(actuator)
Section titled “activate(actuator)”Activates an actuator attached to this controller.
actuator: The actuator to operate on.- type: actuator or the actuator name as a string
deactivate(actuator)
Section titled “deactivate(actuator)”Deactivates an actuator attached to this controller.
actuator: The actuator to operate on.- type: actuator or the actuator name as a string
