Interacting with a GameObject in Fungus

marcosecchi Tutorials, Unity3D 0 Comments

During a Unity3D lab for the Applicazioni digitali per le Arti Visive II course I’m holding at Nuova Accademia di Belle Arti in Milan, I’ve been asked by a student if it’s possible to add some interaction to a GameObject an intercept it with Fungus.

Fungus is a cool opensource library to create interactive and non-linear narratives, but it is mostly focused on 2D.

Luckily it is easily extensible and a simple script just saved the day! I’ve created a downloadable example, and the script is at the bottom of this post.

The script should be added to the clickable Game Object (that must include a Collider component or there won’t simply be interaction): in the Inspector you’ll have to add the Flowchart reference and the messages you want to send, as shown in the picture below:

Fungus Message

Pic. 1 – The Game Object script

For each sent message, you’ll have to create a block in the receiving Flowchart, that should be activated on the Message Received event and that should have the same message sent by the Game Object.

Fungus Message

Pic. 2 – The Flowchart receivers

Asset Store Link

Fungus can be found on the Unity Asset Store clicking on the following link: