Message Actuator Property: body

body:
  • gets/sets the property value (body) to be sent as a message.

Type: 
  • integer or float or boolean or string

Value:

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


################  Get the property value (body) will be sent as a message

# 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 property value
message = act.body
 
Sample Code


################  Set the property name whose value (body) will be sent as a message

# 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 property value
# my property Full Health is an integer

act.body = 100