What it does
game.sendMessage sends Message on a game object. It takes targetId, msg and data. data is optional.
Signature
game.sendMessage(targetId, msg, data?)Arguments
targetIdmsgdataoptional
Example · generated
function start() { game.sendMessage('main', 'Hello');}game.sendMessage is called with values of the shape its signature asks for. The code sits in start(), which the engine calls once, when the entity spawns.