On Receiving Broadcast
Fires when an object receives a broadcast sent through the same named Broadcast channel.
Introduction
On Receiving Broadcast event in the World Editor when-broadcast-is-received-introduction.png The On Receiving Broadcast event in the Script Editor. caption On Receiving Broadcast is the event of the Group group in World Events. It fires when this object receives a broadcast that was sent on a channel it listens to. When it fires, the event hands three values to your script: the Sender that sent the broadcast, the Custom payload carried on the channel, and the Recipient that received it. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. This event lives on the Group component of an object. Add the Group component first if it is not on the object yet, then the event becomes available. Broadcasts are Uni's way for objects to talk to each other without wires: one object sends on a channel, every object listening to that channel receives. The UI twin of this event - When Broadcast is Received in UI Events - does the same job for interface panels. If you want the receiver to be a physical zone instead, compare it with When Trigger Entered , and the component behind it is documented in Object Logic .
Parameters
Sender the Object that sent the Broadcast Custom payload values declared on the selected Broadcast channel Recipient separate from payload; controls who receives the Broadcast Parameter Description
How to Access
How to Access - Event On Receiving Broadcast
How to Use
Select the object and open the Properties panel, then find the Group component block. Press the three dots (...) at the top right of the Group block; in the pop-up list, scroll to the bottom and check When broadcast is received because it is hidden by default, then close the pop-up so the event shows in the block. Press Scripts + next to When broadcast is received , pick the Broadcast channel it should listen to, and add the actions that should run when the signal arrives below it. Press Play and fire that Broadcast from another script, then check that this listener runs its actions. Important: A broadcast only reaches a listener while that listener's canvas is active. World UI pages receive signals only while they are on screen, Prop UI only while the prop is equipped, and Vehicle UI only while the player sits in the driver's seat. If UI 1 is on screen and the listener sits in UI 2, the signal is lost because UI 2 is inactive. To receive broadcasts on every screen at any time, put the listener in the Character UI instead, which stays active for as long as the character exists in the world.
Example
Set Self Group Color after receiving a broadcast change-color-block-on-broadcast.png Example: this listener changes its Group Color when the matching Broadcast is received. caption
Common Uses
Refreshing panels when data changes elsewhere Syncing several UI objects at once Opening or closing panels from world logic
Tip
UI objects listen to the same broadcasts as world objects. One send can update the world and its UI together.