Message Actuator Property: propName

propName
  • gets/sets the game object that messages will be sent to.
     
  • Message Actuator name: To

Type: 
  • string
Note:
  • Sends a message to a Message Sensor(s).
     
  • The message sent will be the value of the selected Property. 
Sample Code


################  Get the game object name that messages will be sent to.

# import bge module
import bge

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

# get the actuator attached to the controller
# my actuator is named Add_Health

act = cont.actuators["Add_Health"]

# get the game object name
name = act.propName
 
Sample Code


################  Set the game object name that messages will be sent to.

# import bge module
import bge

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

# get the actuator attached to the controller
# my actuator is named Add_Health

act = cont.actuators["Add_Health"]

# set the game object name
act.propName = "Health_Bar"