
When I was trying to build the menu and inventory systems, I used a key-pressed function to toggle their appearance and disappearance. However, I encountered a problem: the new system shares the same layer as the game screen. Although the new system visually covers the game, the in-game items underneath can still be clicked through it.
I realized that the issue occurred because my new system wasn’t built on Unity’s UI canvas. Since I don’t know how to control everything through code, I could only rely on Fungus commands to achieve the effect I needed.
Now that I’ve completed all the tasks, I’ve realized that I could have simply disabled the clickable areas of the game screen when a key is pressed. That would’ve achieved the effect I wanted as well. However, when I was building the system, I chose to create a new view to act as a separate canvas.

Pressed Esc Key
When the player presses the ESC key, Fungus executes this command.

By switching the player’s view to another camera view, the menu system’s interface no longer overlaps with the interactive elements of the main game screen, effectively preventing any unwanted interference between the two.
Click Quit Button
When the player selects the “Quit” option, Fungus executes the command to exit the game.

Click Back Button
However, things get more complicated when the player wants to return to the game from the Esc menu. Since not every scene has only one game view, such as Scene: 3.2_Hallway and Scene: 3.2 Hallway, figuring out how to bring the player back to the exact view they were in before entering the Esc menu becomes a challenge.
Back button command in the scene which only has one view, for example, Scene: 2.2_Lobby

Back button command in the scene which only has one view, for example, Scene: 3.2_Hallway

Another issue comes up when dealing with multiple views: if the player opens the Esc menu without activating any of the variables tied to a specific view, the system doesn’t know which view to return to, making the logic more complicated. So I also had to add a fallback command that returns the player to the first view if none of the view-related variables had been triggered.
Moreover, in the final scene, the Basement Scene, there are not only multiple views, but they’re also divided into two groups based on the background. This makes the return logic even more complex.
Back button command in the Scene: 5.2_Basement

I set up group-based variables and used them to track the last view the player passed through, so the system can determine which view to return to.
Leave a Reply