Let's improve the MainFlowchart, so it will listen for an incoming message.
Creating the Block
Select MainFlowchart from the Hierarchy panel and open the editing window. Add a new block called On Coin Collect and add a Debug Log command with some kind of message (for instance 'Coin collected!').
The Debug Log command will trace some information on the Console, for instance errors. We are tracing some text just to be sure that the block is executed.
Adding a MessageReceived event
With On Coin Collect selected, choose from the Execute On Event drop-down Scene > Message Received and in the Message field insert 'coin-collected'.
Save the scene and click the Play button: each time a coin is collected, the console should trace the corresponding message.
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.