5 Minute MAIN MENU Unity Tutorial
Вставка
- Опубліковано 29 сер 2024
- Hoo boy, this was more of a challenge I wanted to do myself, was getting tight on time near the end.
I wanted to try to show how to setup something every game needs, a main menu, in as concise of a way as possible in a Unity Tutorial. I also tried to explain additional things like general UI advice in Unity, as well as Scene management (loading different scenes) and how scenes are built into the project. I know the pace is pretty quick, but hopefully this helps you out!
✨Want to support the channel?
Buy me a coffee ☕: ko-fi.com/bmoli
LIKE the video if you learned something useful, it really helps the channel out.
COMMENT if you have any questions or want to tell me how I went slightly over 5 minutes (does intro and outro count? I'm unconvinced)
➤Join the new DISCORD SERVER: / discord
➤Want to make video games? Start with my tutorial Playlist: • Epic Unity Tutorials
➤5 Minute Tutorial Series: • 5 Minute Games
➤Don't forget to SUBSCRIBE for all the upcoming content.
Thanks for watching!!
~~~~~~~~~~~
ASSET LIST
~~~~~~~~~~~
Red Cliff Background: assetstore.uni...
~~~~~~~~~~~
#bmo #unity #tutorial
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
Ysah
that made me crack up so hard lmao
@@UNKNOWN-fy7qw he is literally reciting it
XD
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.
I love the ending
It was so abrupt...
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
Holy crap this was 10k times easier to understand than all other tutorials I've seen. Thank you.
Happy to hear that!
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
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
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 the Back button is Overlaid on your other buttons in the same scene, you can make a separate script called "Options" and have something like:
under public class
public GameObject options;
void start()
{
options.SetActive(false);
}
then drag it to the Options menu, then drag the options menu to the script bar. Now the Back button should be initially hid, and if you click options it would pop up, and the rest of the code would work the same.
TYSM! This helped a lot!
ive added the options script to the options menu but it isn't doing anything
you now have the N word pass for a day
Thank you!
If this doesn't work for anyone, try capitalizing the S in the Start function. The code above works but you can't just copy and paste it since the function name is case sensitive. Thanks for the help!
you should do a 5 minute series on how to do things in unity, that would be extremely helpful and quicker and not a waste of time, because sometimes i do what people say and it ends out not even working and i noticed i was doing it for and hour or so!? so if it doesnt work atleast you know you didnt loose any of your time making the game.
pathetic, im in 6 hours bro
@@adomasjarmalavicius2808 hours?,haha boi its been 6 DAYS for me
@@keemybrzee8442 2 months for me
@@AlexFernandez-ty7qd Jokes on you I'm dead and I'm still working on it😎
@@MASTERX-nw2gk 🤣🤣🤣
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.
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!
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!
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
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
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();
}
}
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 ❤
you deserve more subs
🙏Thanks
accidentally broke in the Pentagon. Instructions unclear
nahh just kidding was suuuuper usefull!!
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. :)
fast, no bullshit, and right to the point. thank you. I made my first main menu today.
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
For anyone who encountered the issue of ending up with unclickable buttons after following the instructions to a "T", remember to add an EventSystem and then update it (you'll see a prompt in red on the right side int he inspector). After adding this one element missing from a newer Unity version (not added automatically) the play and settings buttons functioned properly.
If it didn’t automatically spawn and eventsystem when I did UI and Image how do I add one?
thnks
Omg thank you, you saved me. The buttons work now!
I need clearer instructions on this, still can't get it to work. EDIT: Nevermind it's because I accidentally set the color of the image to be fully transparent.
I love that quit function. Not because of you awesome tutorial, just for that nice idea for finishing your video :D
Mine does not work at all
@@jeremyjos-rolland1879 build it
So fast. So clean!
The only that that tripped me up was that my Back button was over the Quit button, but the comment section GOT ME!
how do u fix
@@dyl3841 yeah the back is still visible
@@dyl3841 In your Unity inspector, click on your "SettingsMenu" object and uncheck the box in the top of the inspector. This will disable the settings menu.
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.
menus are easy enough to layout. The bugger is the art and scripting for everything to work seamlessly throughout the game :D
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?
Best tutorial on Main menus I could find, easy to follow and straight to the point. Thank you kind Sir!
The algorithm suggested me your video. You're doing something right haha
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".
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
Not all heroes wear caps!! You just gained a subscriber!!
Thank you! 🙏 Really appreciate it
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
I search "Unity 2d menu" on UA-cam, the second video is this one, i'm not disappointed, thanks
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!
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!
You left off so many stuff at the end to make the video 5 minutes long!
Exactly how I would do it!
lmao
I always forget what I’m playing even though I clicked the application 2 seconds ago
Game titles are very helpful
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'
People might forget what they are playing. That was awesome!
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.
🤣🤣🤣 Bro how you ended this tutorial got me LMAO🤣🤣 dopest 5 minutes of the day.
OMG thank you so much for this tutorial. I tried to follow a Brackeys tutorial but this one works and it's fast and easy. You should try and make a video for a wave spawner if possible.
This was so helpful. 2 years later this is still good
Im your 1kth subscriber. I love the videos so far. Keep it up!
You hold a special place in my heart
need short and appropriate tutorials like this! Thank you :)
Does it work with the newest Unity version?
@@FortniteBalls9669 Well I worked with 2019 version, but since this is pretty basic stuff it would work with any latest version I guess!
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....
this is the best main menu tutorial
Thans SO much, im trying to make a multiplayer game for my friends and i to play and this works flawlessly
Glad to hear! Good luck with the game, would love to see it
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
Keep doing your thing its useful for beginners like me
That ending was smooth AF
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
THANK YOU! So quick, so concise, yet well explained
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 is super high quality. If you sounded like brakeys I would have thought it was Brakeys. more subs!!
youre a god!
I really like this. Simple and quick.
Thanks! I'm going to try to keep them shorter, I think its easier to watch
Thanks for the tutorial! You definitely deserve more subs & views!
Thank you! Comments like this really hit home and keep me motivated. Happy you enjoyed it!
great video with all the fundamentals needed to get started! Thanks!
Easy to understand and implement to my project. Thank you so much ! Your tutorials are a goldmine.
Lol best outro. That being said great tut, all you needed, no more!
Love these vids man
Appreciate it 🙏
You're the man BMO, keep up the great tutorials dude!
I love how, when pressing the "Quit" button, the video ends. Intentionally. xD
Thanks for not overcomplicating it
How can i disable that Back button cant be seen on the main menu, i have that glitch, but when i click it, it dissapears, and when i click settings button, it opens normal
help pls?
Either you need to disable the settings menu or check that your buttons load correctly. It’s been 3 months so unless you need it I won’t give a detailed description
@@tdawg6348 speak my lord
used this tutorial in my 2D game was so quick and easy to follow, many thanks !!!
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
the "quit" was quick., thank you!
This was perfect, thank you!
Glad you liked it!
This will be my goto Menu System refresher video. Thanks man!
BMo the Tutorial GOD. I will follow your tutorials into the oblivion uwu
LOL
"uwu"bruh
Fantastic Tutorial! Thank you so much!
When I click play my camera wont show
Is it because im using 3d?
EDIT: Holy shit I fixed it and I was just messing around
Thanks for the video!!
Nice job!
did you khnow that you have 69 subs
how did you fix it tho
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!
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
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
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
really helpful and easy to understand! thank you from a 14 year old beginner game dev :]
You'll be a pro in no time
@@BMoDev i have a question (if you have time to answer), i have the main menu set up and i have added a few buttons to the options menu screen. when i start the game, the buttons supposed to be in the options menu appear immediately, and i cant figure out how to make them show up only when the options button is clicked. can you help? thank you!
@@Arcane.after.hours- select your options menu gameobject in the hierarchy. Then in the inspector un check the box at the top to disable the menu. Good to go
@@BMoDev omg i should have seen that, thank you so much!! now i can actually start on the game itself since i have the menu figured out haha
Tutorials where they add comedy is good
the ending was very smooth tbh :D
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
My like button is so smashed right now...
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!
Incredibly comprehensive and precise :) thank you
Question, how do we import animations for the background?
You have now become my guide to Unity. Thank you :)
awesome, hope I help you on your journey 🙏
Every time i try to add a function i some how mess up. When it says no function on the On click part i cant find the right parts
Same
even though it's late, for people in the future who run into this problem, make sure you drag your main menu script into the main menu object in the hierarchy window. Then the function should appear. At 3:17 in video make sure not to skip.
@@NobodyNamine ok thanks
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
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.
Outro was too perfect.
Brother, you hovered your mourse over the MainMenu empty in the hierarchy tab and then cut the video to creating a script in the project tab. Since this is my first time with unity I thought there was something wrong because I could only create scripts in the project tab and not right on the MainMenu empty like you did... until I realized you just had this strange and deceiving edit.
yeah he uses confusing cuts like this which is slightly confusing but I do appreciate his tutorials
We need more 5 minutes series !!!
Yup, I'm definitely going to keep making them!
I can't even drag the image into the source image wtf
same problem here i followed all of the same steps but no matter what i do the imported asset will not drag on to the source image. I think it may be a problem with a change in unity and its incredibly frustrating
Im late but use RawImage instead
U deserve more subs man😭
It says scene manager doesn't exist in current context.
You just need to add a Using statement at the top of the script!
using UnityEngine.SceneManagement;
you can also 'Right Click' on SceneManager -> Quick Actions and Refactorings -> Add using UnityEngine.SceneManagement.
Same here
@@BMoDev Wow thanks!
But my play button does not work i made all steps but play button does not make any thing
@@BMoDev thanks broo
thank you so much for how quick and simple this is