5 Minute MAIN MENU Unity Tutorial
HTML-код
- Опубликовано: 17 янв 2020
- 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.unity.com/packages...
~~~~~~~~~~~
#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
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
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 🤣🤣🤣
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
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!
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
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!
THANK YOU! So quick, so concise, yet well explained
Best tutorial on Main menus I could find, easy to follow and straight to the point. Thank you kind Sir!
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
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
This will be my goto Menu System refresher video. Thanks man!
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!
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 😅
Holy crap this was 10k times easier to understand than all other tutorials I've seen. Thank you.
Happy to hear that!
thank you so much for how quick and simple this is
used this tutorial in my 2D game was so quick and easy to follow, many thanks !!!
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!
great video with all the fundamentals needed to get started! Thanks!
You're the man BMO, keep up the great tutorials dude!
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
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
Incredibly comprehensive and precise :) thank you
Extremely helpful information, thank you very much
This was perfect, thank you!
Glad you liked it!
you deserve more subs
🙏Thanks
Thanks, this video was very helpful and straight forward.
I really like this. Simple and quick.
Thanks! I'm going to try to keep them shorter, I think its easier to watch
Keep doing your thing its useful for beginners like me
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 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
genuinely very good and digestable tutorial
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.
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"
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!
You have now become my guide to Unity. Thank you :)
awesome, hope I help you on your journey 🙏
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
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!
Thanks! Helpful , quick and to the point
I love this tutorial so much.
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
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.
I search "Unity 2d menu" on RUclips, the second video is this one, i'm not disappointed, thanks
cool, it helped. forgot to add the build order then finally figured it out. Very helpful video.
Nice job getting it to work!
menus are easy enough to layout. The bugger is the art and scripting for everything to work seamlessly throughout the game :D
Im your 1kth subscriber. I love the videos so far. Keep it up!
You hold a special place in my heart
This was so helpful. 2 years later this is still good
People might forget what they are playing. That was awesome!
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. :)
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.
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
the "quit" was quick., thank you!
accidentally broke in the Pentagon. Instructions unclear
nahh just kidding was suuuuper usefull!!
Love these vids man
Appreciate it 🙏
Thanks I've Been Searching For This Like an 6 hours
this is the best main menu tutorial
Not all heroes wear caps!! You just gained a subscriber!!
Thank you! 🙏 Really appreciate it
Easy to understand and implement to my project. Thank you so much ! Your tutorials are a goldmine.
Thank you I’ve been stuck on this for a while I’m trying to make a platformer
this is super high quality. If you sounded like brakeys I would have thought it was Brakeys. more subs!!
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 :)
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();
}
}
it worked thank you so much !!!!! love the ending lmaooo
Really good tutorial dude, thank you. You should make more
That's the plan!
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....
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
Haha, the quit end was pretty good. I didn’t know about that text mesh system. Thanks for your vids bro
You bet!
Great video! Really helped, thanks.
The algorithm suggested me your video. You're doing something right haha
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 ❤
short and simple, u earned new subscriber
the ending was very smooth tbh :D
You left off so many stuff at the end to make the video 5 minutes long!
Exactly how I would do it!
lmao
Question, how do we import animations for the background?
yo this is the best tutorial ever!! 😂
just subscribed!
That ending was smooth AF
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.
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!
Thanks man , really helped out .
For some reason I am getting an error for the mainmenu script saying "The Associated Script Can Not Be Loaded"
youre a god!
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
Thanks for not overcomplicating it
Excellent, straight to the point. I like this! +1 sub.
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
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.
Ending is perfect!
very simple and good tutorial, very nice
I love how, when pressing the "Quit" button, the video ends. Intentionally. xD
BMo the Tutorial GOD. I will follow your tutorials into the oblivion uwu
LOL
"uwu"bruh
🤣🤣🤣 Bro how you ended this tutorial got me LMAO🤣🤣 dopest 5 minutes of the day.
Bro, you saved my Term Paper, thank you!
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
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.
GREAT tutorial!
omfg it was so easy thank you very much