Nand Controller: actuators

actuators
  • Returns a list of the names of the actuators attached to the controller.

Return Type: 
  • string list [ Actuator1,  Actuator2, etc.]
actuators["actuator_name"]
  • Returns a Named actuator.

Return Type: 
  • SCA_IActuator
Nand Controller:
  • A python controller is needed to run the python script used to access any actuators connected to a Controller
Sample Code


################  get a list of the actuators attached to the controller

# import bge module
import bge

# get the python controller
# Note: My Python controller and Nand controller are attached to same game object

python_controller = bge.logic.getCurrentController()

# get the game object that owns the controller
obj = python_controller.owner

# get the Nand Controller attached to the game object
# my Nand Controller is named Nand_1
nand_controller = obj.controllers["Nand_1"]

# get a list of the actuators attached to the Nand controller
act_list = nand_controller.actuators
 
Sample Code


################  get the actuator attached to the controller

# import bge module
import bge

# get the python controller
# Note: My Python controller and Nand controller are attached to same game object

python_controller = bge.logic.getCurrentController()

# get the game object that owns the controller
obj = python_controller.owner

# get the Nand Controller attached to the game object
# my Nand Controller is named Nand_1
nand_controller = obj.controllers["Nand_1"]

# get the actuator attached to the Nand controller
# my actuator is named Motion

act =  nand_controller.actuators["Motion"]