Sends a specified message to all objects and the background. The object that sends the message waits until all objects, that received the message, have finished their scripts. Then the initial script continues.

Broadcast and wait Brick

Why send broadcast messages?

With messages you can communicate and interact between different objects within a scene. It allows one object to send a message to all other objects, and the receiving objects can then react or respond to that message.

How does it work?

  • Sender object: The sender object starts the communication by using a "Broadcast" block. This block is used to send a message to all other objects in the scene (also the background).
  • Receiving object: The receiving object is the one that listens for and responds to messages. It uses the "When you receive" block to detect when a specific message is being received.
  • Message Handling: When the receiving object gets the message, it will execute all the blocks that are beneath the "When you receive" block. This allows you to define custom behavior or actions that occur when a particular message is received.

Correlates with this brick:

When Your Receive Brick
Learn more >>

Example

Create two objects like:

Broadcast and wait Example 1

Tell the panda what to do when it receives the message:

Broadcast and wait Example 2

In game over take this script to specify when the message is sent and what to do when the other objects are finished with their scripts:

Broadcast and wait Example 3

Note: select the same message in both bricks!

Result

Download

Broadcast and wait Result