Main Menu Back button

I’m currently trying to add a back button to my menu system to allow for he user to go back to the main menu from the settings or load game menu however I’m getting a Cyclic resources dependency error which I know is caused by having a collection proxy linking to another collection that has a collection proxy linking back to the previous collection. However, I was wandering how I fix it without having to rewrite my entire main menu?

Error:

Load game menu:

Settings menu:

Main menu:


One solution is to have the proxy collections for your various screens and menus in a single collection which you always have loaded and have loader.script in that collection manage loading and unloading of screens based on game state.

So instead of having a Settings_proxy, NewGame_proxy and LoadGame_proxy in your Main menu and a Home_proxy in your Settings menu and so on you move all of these proxies to a single main/loader collection in your project.

Another great solution is the Monarch asset: https://github.com/britzl/monarch

You can use monarch.back() to pop a screen off the stack and return to your main menu.

1 Like