Fungus Trigger allows you to place triggers in a 2D or 3D game world that trigger Fungus dialogue to appear and that transition control back to the game when dialogue ends.
Set up the project
- Create a new empty project.
- In Window / Asset Store.
- Search for Fungus.
- Download and import Fungus.
Make the FungusTrigger script
- Project / Create new C# Script.
- Rename it FungusTrigger.
- Double click it to edit it. Delete all the code.
- Copy the FungusTrigger.cs source code from pastebin.
- Paste the code into the script text editor.
Make the Fungus Trigger object
- Hierarchy / Create / 3D Object / Cube.
- Rename it “Fungus trigger” and hit return.
- Inspector / Collider / isTrigger = true (check the checkbox).
- Place the FungusTrigger script on the cube.
Make a flowchart in Fungus
- Tools / Fungus / Create Flowchart
- A Flowchart pops up in the Inspector.
- Click Open Flowchart Window in its inspector.
- Drag the resulting window to dock it alongside the Scene and Game tabs.
- It starts with a blue New Block.
Make the Fungus story block display a message
- Select it.
- Inspector / Execute On Event / Scene / Message Received
- Set it to “post touched”
- At bottom of inspector is a + button that adds a command to this block.
- + / Narrative / Say
- Story Text = “You have touched the trigger and displayed this message”