# Sensor(bpy_struct)

base class — `bpy_struct`

subclasses — `ActuatorSensor`, `AlwaysSensor`, `ArmatureSensor`, `CollisionSensor`, `DelaySensor`, `JoystickSensor`, `KeyboardSensor`, `MessageSensor`, `MouseSensor`, `NearSensor`, `PropertySensor`, `RadarSensor`, `RandomSensor`, `RaySensor`

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

  Game engine logic brick to detect events

  `active`

    Set active state of the sensor

    Type: | boolean, default False

  `controllers`

    The list containing the controllers connected to the sensor

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

  `invert`

    Invert the level(output) of this sensor

    Type: | boolean, default False

  `name`

    Sensor name

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

  `pin`

    Display when not linked to a visible states controller

    Type: | boolean, default False

  `show_expanded`

    Set sensor expanded in the user interface

    Type: | boolean, default False

  `tick_skip`

    Number of logic ticks skipped between 2 active pulses (0 = pulse every logic tick, 1 = skip 1 logic tick between pulses, etc.)

    Type: | int in [0, 10000], default 0

  `type`

    Type: | enum in [‘ACTUATOR’, ‘ALWAYS’, ‘ARMATURE’, ‘COLLISION’, ‘DELAY’, ‘JOYSTICK’, ‘KEYBOARD’, ‘MESSAGE’, ‘MOUSE’, ‘NEAR’, ‘PROPERTY’, ‘RADAR’, ‘RANDOM’, ‘RAY’], default ‘ALWAYS’

  `use_level`

    Level detector, trigger controllers of new states (only applicable upon logic state transition)

    Type: | boolean, default False

  `use_pulse_false_level`

    Activate FALSE level triggering (pulse mode)

    Type: | boolean, default False

  `use_pulse_true_level`

    Activate TRUE level triggering (pulse mode)

    Type: | boolean, default False

  `use_tap`

    Trigger controllers only for an instant, even while the sensor remains true

    Type: | boolean, default False

  `link`(controller)

    Link the sensor to a controller

    Parameters: | controller (`Controller`) – Controller to link to

  `unlink`(controller)

    Unlink the sensor from a controller

    Parameters: | controller (`Controller`) – Controller to unlink 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

`Controller.link` `Controller.unlink` | `GameObjectSettings.sensors`