# Controller(bpy_struct)

base class — `bpy_struct`

subclasses — `AndController`, `ExpressionController`, `NandController`, `NorController`, `OrController`, `PythonController`, `XnorController`, `XorController`

class `bpy.types.``Controller`(bpy_struct)

  Game engine logic brick to process events, connecting sensors to actuators

  `active`

    Set the active state of the controller

    Type: | boolean, default False

  `actuators`

    The list containing the actuators connected to the controller

    Type: | `bpy_prop_collection` of `Actuator`, (readonly)

  `name`

    Type: | string, default “”, (never None)

  `show_expanded`

    Set controller expanded in the user interface

    Type: | boolean, default False

  `states`

    Set Controller state index (1 to 30)

    Type: | int in [1, 30], default 0

  `type`
    - `LOGIC_AND` And, Logic And.
    - `LOGIC_OR` Or, Logic Or.
    - `LOGIC_NAND` Nand, Logic Nand.
    - `LOGIC_NOR` Nor, Logic Nor.
    - `LOGIC_XOR` Xor, Logic Xor.
    - `LOGIC_XNOR` Xnor, Logic Xnor.
    - `EXPRESSION` Expression.
    - `PYTHON` Python.

    Type: | enum in [‘LOGIC_AND’, ‘LOGIC_OR’, ‘LOGIC_NAND’, ‘LOGIC_NOR’, ‘LOGIC_XOR’, ‘LOGIC_XNOR’, ‘EXPRESSION’, ‘PYTHON’], default ‘LOGIC_AND’

  `use_priority`

    Mark controller for execution before all non-marked controllers (good for startup scripts)

    Type: | boolean, default False

  `link`(sensor=None, actuator=None)

    Link the controller with a sensor/actuator

    Parameters: | sensor (`Sensor`, (optional)) – Sensor to link the controller to actuator (`Actuator`, (optional)) – Actuator to link the controller to

  `unlink`(sensor=None, actuator=None)

    Unlink the controller from a sensor/actuator

    Parameters: | sensor (`Sensor`, (optional)) – Sensor to unlink the controller from actuator (`Actuator`, (optional)) – Actuator to unlink the controller from

Inherited Properties

`bpy_struct.id_data` |

Inherited Functions

`bpy_struct.as_pointer` `bpy_struct.driver_add` `bpy_struct.driver_remove` `bpy_struct.get` `bpy_struct.is_property_hidden` `bpy_struct.is_property_readonly` `bpy_struct.is_property_set` `bpy_struct.items` | `bpy_struct.keyframe_delete` `bpy_struct.keyframe_insert` `bpy_struct.keys` `bpy_struct.path_from_id` `bpy_struct.path_resolve` `bpy_struct.property_unset` `bpy_struct.type_recast` `bpy_struct.values`

References

`Actuator.link` `Actuator.unlink` `GameObjectSettings.controllers` | `Sensor.controllers` `Sensor.link` `Sensor.unlink`