Actuator Sensor: actuator

actuator
  • gets/sets the name of Actuator Logic Brick the actuator sensor is set to monitor.

Type: 
  • string
Actuator Sensor:
  • The actuator sensor and the actuator logic brick being monitored must be on the same object.
     
  • When the Actuator Logic Brick being monitored starts: one positive pulse is sent to the controller(s).
     
  • When the Actuator Logic Brick being monitored stops: one negative pulse is sent to the controller(s).
Sample Code


################  Get the name of the actuator being monitored

# import bge module
import bge

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

# get sensor attached to the controller
# my actuator sensor is named Attack
sen = cont.sensors["Attack"]

# get name of the actuator being monitored
name = sen.actuator
 
Sample Code


################  Set the name of the actuator being monitored

# import bge module
import bge

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

# get sensor attached to the controller
# my actuator sensor is named Attack
sen = cont.sensors["Attack"]

# set the name of the new actuator to be monitored
# name of the actuator to be monitored is Add_Wolf

sen.actuator = "Add_Wolf"