
- Sends a message header. No body. Sent to all game objects.
subject:
- Message header
- Type: string
- Sends a message header and message body to all game objects.
subject:
- message header
- Type: string
- message body
- Type: string
- Sends a message header and a message body. Sent to a game object.
subject:
- message header
- Type: string
- message body
- Type: string
- The name of the game object to send the message to
- Type: string

################### send a message header to all game objects
# import bge
import bge
# get controller
cont = bge.logic.getCurrentController()
# get object that controller is attached to
obj = cont.owner
# subject header
subject = "Health Potion"
# send message
obj.sendMessage(subject)
################### send a message header and body to all game objects
# import bge
import bge
# get controller
cont = bge.logic.getCurrentController()
# get object that controller is attached to
obj = cont.owner
# subject header
subject = "Health Potion"
# subject body
body = "10"
# send message
obj.sendMessage(subject, body)
################### send a message header and body to one game object
# import bge
import bge
# get controller
cont = bge.logic.getCurrentController()
# get object that controller is attached to
obj = cont.owner
# subject header
subject = "Health Potion"
# subject body
body = "10"
# game object to send message to
# my game object is named Suzanne
to = "Suzanne"
# send message
obj.sendMessage(subject, body, to)