- Home /
How to connect main menu with the game?
Guys i have a Main Menu and i have my game. I tried to search on google but every single one was how to create a main menu blah blah. HOW THE HELL DO I ADD THE MAIN MENU TO THE GAME WHEN I HAVE IT xd PLZ HELP :(
Do you mean you have a main menu scene and a game scene and you want to go from one to the other?
Answer by MT369MT · Sep 11, 2017 at 05:46 PM
If you mean switching from a scene to another: Add to the top of the script this:
using UnityEngine.SceneManagement
And under Update you can add for exemple:
if (Input.GetKeyDown(''space'')) { SceneManager.LoadScene("the name of your main menu scene") }
Be sure that your scenes (main menu and levels) are added to the build of the game. If not go under File -> Build Settings and add you scenes to it