@@roblenwithyou8618 so you know when at the top of the screen it says using UnityEngine; ? well, right under it put using UnityEngine.SceneManagement; so that it knows to switch scenes when you wright the scene scripts.
Great tutorial! However i think its important to mention that in some projects you may need to change your image's texture type from "Default" to "Sprite(2D and UI)" before you can drag it to the image source.
@@MASTERX-nw2gk So i tried replying to this twice now and for whatever reason its not showing up so please excuse me if there are multiple replies by me. So the way you change the texture type is while in unity, in the project tab, in the assets menu click on the image that you want to change the texture type of, once highlighted under the inspector tab for that image the first drop down menu should be "Texture Type". Open the drop down menu and click "Sprite (2D and UI)". That should be the solution youre looking for, hope it helps! :)
Only thing to add is for the SettingsMenu you have to manually set it not active in the Hierarchy otherwise they both load on run. On the object itself left of the name there is a tick box.
For any who have an overlapping BACK button, (assuming you named everything the same as he did) select "SettingsMenu" in the Hierarchy tab. Then in the Inspector tab uncheck the box that is to the right of the 3D cube outline, and to the left of where you name the object. Now the BACK button shall only show after clicking on the Settings Button. I hope this helped!
If you're having trouble setting the image as the background try changing the texture type to "Sprite (2d and UI)" in the inspector for it. I was so confused why it wasn't working because it let me use it earlier, i think once you import textmesh pro stuff it messes with your settings a little. I nearly went insane.
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class menuscript : MonoBehaviour { public void PlayGame() { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);// this can load the scene number 1 (game)//SceneManager.GetActiveScene().buildIndex +1 } public void QuitGame() { Application.Quit(); } }
As useful as this tutorial was, I still found it too fast and had to frequently rewind to catch things. I had to time the pause very precisely in order to see the first line of code for the created script.
Just in case anyone has this issue: Don't call your script SceneManager, otherwise it will replace the SceneManager in SceneManagement and it won't show any methods. :)
@@jakewill8702 Yep! When you play in the Editor it won't, but you can test it by going to File->Build & Run, it should close the application when its running for real!
Um... You may have edited out too much to make it shorter. You skipped over the step of adding the using statement in the script, and you jumped over the onClick settings for GameObject.SetActive. Yes the tutorial was technically short, but I had to keep going back to see what you did. You should make sure your instructions include ALL steps.
For those experiencing issues with the code-I was having issues with the quit feature not appearing, this code fixed it- THANKS CHATGPT using UnityEngine; using UnityEngine.SceneManagement; public class MainMenu : MonoBehaviour { public void PlayGame() { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); } public void Options() { Debug.Log("Options not implemented yet"); } public void QuitGame() { Application.Quit(); } }
I just made my first game (including menu) in Script and I made it work for PC and Mobile Controls as well, so that was kinda tricky to do, and now it‘s really interesting to see, how another engine does it. I love that it comes with auto-generated events for the buttons. So thank you, this was very interesting and informative to watch.
Helpful, but there were definitely points where you didn't mention things you were doing. For instance, the using UnityEngine.SceneManagement; (which you addressed) and also setting the On Click () function to GameObject.SetActive when you were setting up the options button to hide the MainMenu. That one took me a few minutes because the cut you did to that point really distracted me from the fact that the dropdown menu changedd.
You just saved my life with this video. I had already composed the music for the main menu which I don't yet have, but soon will thank to you and this wonderful video! 🙂
Anyone having problems with the selected color option in the button, just set navigation to none and then set the selected color Alpha to 0, It works like a charm!
this is good. I forgot how buttons worked lol. I took this video and went straight to animating a menu with an animation controller. On the transition you just put a trigger, which works pretty much the same as turning on and off the menu's
i liked your video, now i can make some screens, but was super hard to follow even on 0.75 speed. Maybe people like my prefer a 10min video than a 5min video that you can take 30mins to follow completly thanks a lot for your work
really yotube, really google, took me an hour to find this toturial and in the first minute of this tutorial I got my answer, I am really begining to question the intelligence of the programmers and people in FANG like companies. Wasting 1 hours of my precious time because you can't fine tune your algorithms , sad just sad,all I wanted to know was how to put a freaking image in the background. Thank you Bmo you a re a god like youtuber, got a subscriber here! keep it up!
Thanks for this quick tutorial on main menus this helped me a lot more than that famous dude brackeys. even tho this is only 5 minutes (which is a good thing!)
I hit play and the Main Menu and the Options Menu shows at the same time and now it looks like a mess, for now, I disabled the Options Menu for the time being, help
I have the same problem.. Did you fix it? EDIT: I fixed it. You are not suppose to drag the code to the "On Click ()" you are suppose to drag the gameObject "MainMenu" into the "On Click ()"
Nathalie Orozco the C# script you used to write all your code in should be draged in to the ”MainMenu” gameObject. After that you drag the gameObject (MainMenu) into the ”On Click ()” inside the button’s inspector
My quit and back buttons are overlapping when I load up the game. It disappears soon as I click settings and works fine after that. How can I make sure the back button is not showing right at load? Never mind. Set the options menu to be inactive.
This was exactly what I wanted and was done so well and clearly thanks so much!!! I'm making a frog game :-) This also taught me new unity tips!! 10/10 vid gonna look at your others now
I followed every step here but for some reason my main menu buttons are not interacble. Clicking or hovering over them doesn't do anything. Yes, each button is checked for "interactable" and the script is coded & attached correctly. Anything else I am missing that wasn't shown in this video?
@@Patukakkonen Turns out I had removed the event system component from my event system object. Make sure that's working. And if you're using the old input manager, also add the Input Manager UI component.
"off camera ive been working with another scene, so i have this main menu scene that we've been working on" now heres where you got me confused. What we've been working on is a canvas which i cant drag into the build settings. And you dont explain how the canvas suddenly turned into a scene. someone explain?
For those having an error with SceneManager make sure the top of your script has this statement:
using UnityEngine.SceneManagement;
what statement?
BRUH
@@roblenwithyou8618 so you know when at the top of the screen it says using UnityEngine; ? well, right under it put using UnityEngine.SceneManagement; so that it knows to switch scenes when you wright the scene scripts.
I know that
4:00 pause and look at the imports basicly line 4
and finally you can also qui-
Hi can you give me the code i cannot see properly plz
that made me crack up so hard lmao
@@UNKNOWN-fy7qw he is literally reciting it
XD
@@UNKNOWN-fy7qw what
Instructions unclear, created GTA 6
ty for gta6
THANKS MATE 😂😂
I ended up with Super Mario 67 if that smells good to anyone.
@@presidentobama2561smells good to me
Wow.
Great tutorial! However i think its important to mention that in some projects you may need to change your image's texture type from "Default" to "Sprite(2D and UI)" before you can drag it to the image source.
Can you please tell me how to do that im stuck in this situation where I can't drag my image to the source image
@@MASTERX-nw2gk So i tried replying to this twice now and for whatever reason its not showing up so please excuse me if there are multiple replies by me. So the way you change the texture type is while in unity, in the project tab, in the assets menu click on the image that you want to change the texture type of, once highlighted under the inspector tab for that image the first drop down menu should be "Texture Type". Open the drop down menu and click "Sprite (2D and UI)". That should be the solution youre looking for, hope it helps! :)
@@marshall123x Thank you so much I really Appreciate it !!!
@@MASTERX-nw2gk np, glad i could help! :)
I can confirm this works
I love the ending
It was so abrupt...
Only thing to add is for the SettingsMenu you have to manually set it not active in the Hierarchy otherwise they both load on run. On the object itself left of the name there is a tick box.
When I do this the back button doesn't appear in the settings menu, there are just no buttons, only the background image
thk that was my problem hahaha
Thanks man u helped me so much.
thank you!!!
I still have this problem the first time i load it. If i hit settings and go back its normal and works
Holy crap this was 10k times easier to understand than all other tutorials I've seen. Thank you.
Happy to hear that!
This guy teaching us things in 5 minutes faster than my teachers with 6 months of class
True but most of the time the longer ones are more in depth, but this specific tutorial is still so amazing.
For any who have an overlapping BACK button, (assuming you named everything the same as he did) select "SettingsMenu" in the Hierarchy tab. Then in the Inspector tab uncheck the box that is to the right of the 3D cube outline, and to the left of where you name the object. Now the BACK button shall only show after clicking on the Settings Button. I hope this helped!
5 minutes on the dot 😂 super helpful, might be my favorite one yet
Hahah I had to pickup the pace near the end to make it, was a close one. Thanks!
5:09, technically, but still 😅
If you're having trouble setting the image as the background try changing the texture type to "Sprite (2d and UI)" in the inspector for it.
I was so confused why it wasn't working because it let me use it earlier, i think once you import textmesh pro stuff it messes with your settings a little. I nearly went insane.
Thanks man
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class menuscript : MonoBehaviour
{
public void PlayGame()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);// this can load the scene number 1 (game)//SceneManager.GetActiveScene().buildIndex +1
}
public void QuitGame()
{
Application.Quit();
}
}
thank you!
thank you! :)
omg thankyou so much i added buildIndex * 1 by mistake and have been facing problem from last 3 days finally it worked!!
Thanks For Code Fix
Love uuu ❤
As useful as this tutorial was, I still found it too fast and had to frequently rewind to catch things. I had to time the pause very precisely in order to see the first line of code for the created script.
Just in case anyone has this issue:
Don't call your script SceneManager, otherwise it will replace the SceneManager in SceneManagement and it won't show any methods. :)
I love you so much dude. I needed this done in like 5 minutes for a class project due in a bit and you came in clutch.
how convenient
accidentally broke in the Pentagon. Instructions unclear
nahh just kidding was suuuuper usefull!!
Lol @the ending. Thanks, that was such a fast turnaround from when I asked about main menus on the last video! And it's exactly what I needed.
I got you
@@BMoDev Hey so i have a question will the quit Button REALLY work xD?
@@jakewill8702 Yep! When you play in the Editor it won't, but you can test it by going to File->Build & Run, it should close the application when its running for real!
you deserve more subs
🙏Thanks
Um... You may have edited out too much to make it shorter. You skipped over the step of adding the using statement in the script, and you jumped over the onClick settings for GameObject.SetActive. Yes the tutorial was technically short, but I had to keep going back to see what you did. You should make sure your instructions include ALL steps.
hi im also hiaving trouble with that part and im so confused, can you help me on the GameObject.SetActive?
This video is legendary. This is too much help, I'd normally have to go through 20 videos to find this much useful information. Thank you very much!
Glad you found it helpful!
I can't select the function in the on click thing. In the drop-down it doesn't say: "GameObject", "RectTransform" or "MainMenu", only "Monoscript"
You need to drag the main menu game object on the small box under "On click".
For those experiencing issues with the code-I was having issues with the quit feature not appearing, this code fixed it- THANKS CHATGPT
using UnityEngine;
using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour
{
public void PlayGame()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
public void Options()
{
Debug.Log("Options not implemented yet");
}
public void QuitGame()
{
Application.Quit();
}
}
I just made my first game (including menu) in Script and I made it work for PC and Mobile Controls as well, so that was kinda tricky to do, and now it‘s really interesting to see, how another engine does it. I love that it comes with auto-generated events for the buttons. So thank you, this was very interesting and informative to watch.
What is your game ? Kinda curious
menus are easy enough to layout. The bugger is the art and scripting for everything to work seamlessly throughout the game :D
this is taking me already 4 hours
What're you having trouble with?
@@BMoDev im mising refrences i think something to do with MainMenu
@@BMoDev
'cs0234'
Helpful, but there were definitely points where you didn't mention things you were doing. For instance, the using UnityEngine.SceneManagement; (which you addressed) and also setting the On Click () function to GameObject.SetActive when you were setting up the options button to hide the MainMenu. That one took me a few minutes because the cut you did to that point really distracted me from the fact that the dropdown menu changedd.
You also did not cover how to set the "Back" button to Active = False to start; I will figure this out, but again, frustrating.
the BEST
should've known your channel before
hope to see that u have 100k+ subs
you deserve it
keep going
Wow! You are too kind 🙏 I'll try to live up to that
You just saved my life with this video. I had already composed the music for the main menu which I don't yet have, but soon will thank to you and this wonderful video! 🙂
Nice, I wanna hear it
Anyone having problems with the selected color option in the button, just set navigation to none and then set the selected color Alpha to 0, It works like a charm!
I always forget what I’m playing even though I clicked the application 2 seconds ago
Game titles are very helpful
thanks for the Tutorial you really do deserve more subs and views, it was perfect for what I needed and helped a lot
Thank you, I really appreciate that! I'm truly happy it helped you
@@BMoDev but for the image it does'nt work
this is good. I forgot how buttons worked lol. I took this video and went straight to animating a menu with an animation controller. On the transition you just put a trigger, which works pretty much the same as turning on and off the menu's
You left off so many stuff at the end to make the video 5 minutes long!
Exactly how I would do it!
lmao
I search "Unity 2d menu" on RUclips, the second video is this one, i'm not disappointed, thanks
i liked your video, now i can make some screens, but was super hard to follow even on 0.75 speed. Maybe people like my prefer a 10min video than a 5min video that you can take 30mins to follow completly
thanks a lot for your work
Yeah really 1 hour and a half work for a video from 5min😂
pause button
really yotube, really google, took me an hour to find this toturial and in the first minute of this tutorial I got my answer, I am really begining to question the intelligence of the programmers and people in FANG like companies. Wasting 1 hours of my precious time because you can't fine tune your algorithms , sad just sad,all I wanted to know was how to put a freaking image in the background. Thank you Bmo you a re a god like youtuber, got a subscriber here! keep it up!
In my "On Click()" section, it is letting me put in the .cs but not giving me any options for function to use. Anyone have an idea?
same did you find fix solution?
here one year later, same problem
here 3 years later, same problem
Thanks for this quick tutorial on main menus
this helped me a lot more than that famous dude brackeys.
even tho this is only 5 minutes (which is a good thing!)
Lmao, thanks, I appreciate that. I love Brackeys though they make amazing content.
Hey can you help me w/ something? when i tried to put all of the buttons on the "On click " it doesnt work, how did you select everything?
@@nathlexandra just do each individually if it doesn't work .you dont have to highlight them
@⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻⸻
This name....
Keep doing your thing its useful for beginners like me
Fantastic Tutorial! Thank you so much!
I love how, when pressing the "Quit" button, the video ends. Intentionally. xD
this is the best main menu tutorial
youre a god!
My like button is so smashed right now...
I hit play and the Main Menu and the Options Menu shows at the same time and now it looks like a mess, for now, I disabled the Options Menu for the time being, help
When i have the back button say back it covers the quit
You have to disable SettingsMenu in the inspector of SettingsMenu, uncheck the box left to the name.
@@fico777 thanks man!
@@fico777 BRO, cheers for that!
THANK YOU! So quick, so concise, yet well explained
hey! great tutorial, but is there any way to hide the backbutton from the settings menu from being displayed on the main menu? noticed it duplicated.
I have the same issue 7 months later lol
🤣🤣🤣 Bro how you ended this tutorial got me LMAO🤣🤣 dopest 5 minutes of the day.
This was perfect, thank you!
Glad you liked it!
People might forget what they are playing. That was awesome!
Having a issue with the button function... I click on no function, then MainMenu, but there is no PlayGame or QuitGame like the script..
I have the same problem.. Did you fix it?
EDIT: I fixed it. You are not suppose to drag the code to the "On Click ()" you are suppose to drag the gameObject "MainMenu" into the "On Click ()"
Flexter I think that’s what I did but I’ll try again and see what it does
@@FlexterChannel Im having the same problem it just doesnt work i dont get it
Nathalie Orozco the C# script you used to write all your code in should be draged in to the ”MainMenu” gameObject. After that you drag the gameObject (MainMenu) into the ”On Click ()” inside the button’s inspector
great video with all the fundamentals needed to get started! Thanks!
Love these vids man
Appreciate it 🙏
My quit and back buttons are overlapping when I load up the game. It disappears soon as I click settings and works fine after that. How can I make sure the back button is not showing right at load?
Never mind. Set the options menu to be inactive.
Oh cool thanks dude same problame
Tutorials where they add comedy is good
this is super high quality. If you sounded like brakeys I would have thought it was Brakeys. more subs!!
guys remind if need to change the scene remember need to put
"using UnityEngine.SceneManagement;" on the top side
Damn this is one amazing 5 minutes tutorial ! , I learned a lot of things in less than 30 minutes , thank you !
I appreciate the kind words
@@BMoDev You have no idea how much this video helps , thanks for sharing your knowledge sir :)
This will be my goto Menu System refresher video. Thanks man!
Question, how do we import animations for the background?
thank you. This worked perfectly
Great tutorial but when I did the last part it went to the back page but wouldn't go back, I double checked and I had the setup correct
0:50 THAT PART! WHAT ARE YOU DOING THAT I'M NOT??
Easy to understand and implement to my project. Thank you so much ! Your tutorials are a goldmine.
the ending was very smooth tbh :D
Please help, when i start my screen, both the quit and back button in vissible
select your OptionsMenu, in the inspector uncheck the box at the top to disable it.
This was exactly what I wanted and was done so well and clearly thanks so much!!! I'm making a frog game :-) This also taught me new unity tips!! 10/10 vid gonna look at your others now
Uhm nothing worked I got no options that have anything to do with the quit or play game code
used this tutorial in my 2D game was so quick and easy to follow, many thanks !!!
thank you so much for how quick and simple this is
Gas tutorial; bonus points for that ending 😭
Nice, most of the stuff I knew, but still I learned something and gave me a kick start to finally stop slacking and do the menus for my hobby project!
Tip; watch on half speed
This is the way
I followed every step here but for some reason my main menu buttons are not interacble. Clicking or hovering over them doesn't do anything. Yes, each button is checked for "interactable" and the script is coded & attached correctly. Anything else I am missing that wasn't shown in this video?
Damn i have the same problem
@@Patukakkonen Turns out I had removed the event system component from my event system object. Make sure that's working. And if you're using the old input manager, also add the Input Manager UI component.
@@whatwouldscotdo3594 Where am i meant to put the Input manager thingy?
We need more 5 minutes series !!!
Yup, I'm definitely going to keep making them!
genuinely very good and digestable tutorial
This was so helpful. 2 years later this is still good
haha you were just on time haha I died at the end when you cut in the middle of the sentence XD
Outro was too perfect.
Best tutorial every fr
Thanks!
very simple and good tutorial, very nice
i like your vids cuz you talk alooooot and i like these people who talk alot keep it up!
:D
i subed
Haha, the quit end was pretty good. I didn’t know about that text mesh system. Thanks for your vids bro
You bet!
short and simple, u earned new subscriber
Thanks, this video was very helpful and straight forward.
"off camera ive been working with another scene, so i have this main menu scene that we've been working on"
now heres where you got me confused.
What we've been working on is a canvas which i cant drag into the build settings. And you dont explain how the canvas suddenly turned into a scene. someone explain?
very good tutorial
and code
U deserve more subs man😭
How do i fix buttons not highliting when i hover over them
it worked thank you so much !!!!! love the ending lmaooo
This is still relevant and helpful 2 years later! Thank you!
No it aint you can't even click and drag the image
Thanks! Helpful , quick and to the point
yo this is the best tutorial ever!! 😂
just subscribed!
I love this tutorial so much.
Now I Know How To Make A Main Menu. Thanks
And finally you can also quit- *presses quit* (INSTANT TRANSITION TO OUTRO MUSIC)
Alright this is what i needed thanks for the Vid
Glad to hear it!
Thank you so much very clear
Bro, you saved my Term Paper, thank you!