Back
Close

Unity3D and Fungus Tutorial: PickUps

marcosecchi
16.1K views
Previous: Sending a Message Next: Tracking Points

Receiving a Message

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.

Debug

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'.

Receiving the Message

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.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants