FYI this tutorial still works (in general). There are still a few problems in this tutorial as Unity has updated and things have changed. Here are some problems people seem to be facing with the fixes: 1 - Background Image can't be applied Select the image from your assets folder and open it in the inspector. Change the texture type from (Default) to (Sprite 2D and UI). It can now be used as an Image in the UI 2 - Game Scene is dark after running Menu Scene In both scenes go Window > Rendering > Lighting > Scene and at the bottom click on the arrow on the Generate Lighting Tab. Disable (Auto Generate) if it's on, then select Clear Baked Data, then select generate lighting. 3 - TextMeshPro not in asset store TextMeshPro is now built into Unity and can be used without needing to download further files. It can be used as an alternative to basic (Text).
There are 3 times you visit a Brackey's tutorial: The first one is when you copy it. The second one is when you forget one thing. The third one is when you show it to a friend.
0:00 Intoduction 0:12 Canvas and Panels 1:30 Text Mesh Pro 3:10 Colour Gradient 4:00 Text to Button 5:10 Duplicate Button 6:25 Basic Options menu and Slider 8:00 Functionality 10:20 Add Actions to Buttons
Also here is the code if anyone wants to copy paste, but i recommend watching the video its pretty educational using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class mainmenu : MonoBehaviour { public void PlayGame() { SceneManager.LoadScene(1); } public void QuitGame () { Debug.Log("QUIT!"); Application.Quit(); } }
Thank you! you are always amazing. I took up coding about 2 years ago and then had a baby and put my dreams on hold. Now hes a bit older, I'm less preoccupied with things and want to get back into it. I am so surprised how much I remember and re watching your videos has helped so much. Thank you again!
I for one, personally thank you. I’ve been struggling to create an effective main menu that works. Following your tutorial, has helped me tremendously. You have gained a subscriber.
I was trying to learn some simple unity scripting to show my boss a proposal and nothing made sense or was relevant, but in your video you made it extremely easy to follow along so thank you!
this help me with my college assignment alot, i love brackeys, i dont know why he quit. He is the best person on youtube for unity. He is better then my college course which doesn't teach me how to make a game yet its a games development course. Thankfully I have brackeys!
HIs tutorials aren't for the absolute beginner who don't want to do any coding but if you aren't that way and know your way around Visual Studio, or some other development platform, you will learn at least 5 cool new things in his quick 10-15 minute tutorials. I'll admit I'm still fairly new to Unity development but I've done a lot of game modding in the past so learning it isn't hard and I love Brackey's tutorials. Quick, to the point, and still very useful and informative.
Great tutorial as always! When I was doing menu switching in my project, I had a separate function that took care of the switching. I didn't think of using it the way you did it. Pretty damn neat. Thanks!
If you are confused and can't find TextMesh Pro in the Asset store, it is already included with your version of Unity (This is only included with versions 2018 and higher)
I already know how to make a normal start game/quit game menu, but I never experimented with giving options functionality. Next tutorial a functional option menu would be a great idea :D Love the vids btw
Another great tutorial! I'll definitely implement something like this in my project. These are very concise and easy to understand. How long have you been working with Unity? It seems like you know almost everything about the software.
I would love an options menu tutorial, and I think these are the things you should cover in it: - Resolution - Volume (and how to separate music volume and effects volume) - Graphics options - Mouse sensitivity I would also like a tutorial for key binds but I think thats a bit more advanced. Love your videos!
Ik im late... Like really late. But in his simple game tutorial episodes if you watched it through he shows how to make a move you left and d move you right, you could improvise a little on the code and you would be able to make say L enable a colour change on your player, or obstacle for example. Im sure you know this, but this link docs.unity3d.com/ScriptReference/ Shows you pretty much if not all codes you can use in unity, on the left just click UnityEngine if thats what you are using and then go from there! Good luck!
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class NewBehaviourScript : MonoBehaviour { public void PlayGame () { SceneManager.LoadScene (SceneManager.GetActiveScene ().buildIndex + 1); }
public void QuitGame () { Debug.Log ("QUIT!"); Application.Quit(); }
Sir you are the best man on earth so amazing videos My whole summer vacations have become fruitfull only because you Thank You Soon supporting you on Paetron...❤❤
Anyone using this guide in 2021 or later: You will probably get a SceneManagement error in your Unity Compiler following this guide. First be sure to download the latest version of Microsoft Visual Studio, next be sure to select "Game Development with Unity" when installing, and if you did not just go to Modify to add the version. Finally and most importantly be sure to in Unity go to Edit>Preferences and select your version of MVS as the preferred editor and if you need to set the compiler check box on. Later version of Unity do not seem to use compiler check box on though. After that you should be golden and can continue to follow this guide.
You are the best tutorial based youtuber i have encountered. You know how to make complex programming projects and neat coding that i have been looking for, for days. I wish you well and a brilliant career :), subscribed :)
Yasser Sedrati it actually reminds me of his first old logos with the banner and everything maybe he did that on purpose and it's a anniversary or something?
I was doing the tutorial when at 9:44 he added the function PlayGams, I double checked my code and it was the exact same as his except some messages weren’t colored the same as his (my MainMenu was geek instead of orange, my monobehavior was white instead of orange, my PlayGame was yellow instead of white, and both of my scenemanagers at the bottom were white instead of orange) can someone please help me fix this.
For those who, like me, had a "no function" in the dropdown list of the On Click () behavior, here is what to do: 1) When you created you UI, Unity created a GameObject called "EventSystem". 2) Select "EventSystem" and attach the MainMenu script 3) In the PlayButton and QuitButton, instead of attaching the MainMenu script on the On Click () behavior, attach the "EventSystem" object 4) Now it will show the functions correctly in the dropdown list :)
I just wanna say that its necessary to have the event system in your canvas, otherwise the button actions wont work i just had a problem when my button didnt work entirely when i deleted the event system , if u already did delete it go to create > UI >event system (Hope this helps someone).
i scaled up my background and made an animation for it to sway and slapped on some lemmino music. holy MOLY is my game looking good! cant wait to release it! thank you brackeys for everything you've done for us! youre the reason i can actually be a game dev
can you please make a video on how to make a full options menu with like resolution, graphics, working volume changer for all scenes, controls, etc. Thank You! This video was amazing and really helpful!
'public void PlayGame ()' if you do not have the PlayGame function, then you should remove the space in the code like this 'public void PlayGame()'. If you get errors then you probably didn't add 'using UnityEngine.SceneManagement;' to the very top of the code (maybe it will help someone)
UPDATE: If it's not working at all, you might be using the new Input System instead of the Legacy one. Check that (Project Settings -> Player -> Active Input Handling), and if you are, make sure your Event System is updated, containing the new InputSystemUIInputModule. Then apply your inputs in the Actions Asset and assign the inputs to the events ("point", "left click", "submit", etc.). That solved it for me.
Very late and also I never leave TH-cam comments but I had to for this one - I am a fairly experienced programmer and even I spent an embarrassing amount trying to figure this out. Video solved it for me in ten minutes you are a God sir
too the 2 peopel that have the same problem as me where the buttons wont even highlight, make the eventsystem a child of your canvas, then look at the component. if the input system seems to have an error LOOK AT IT it will tell you to update the input system with a very handy button below that to do it for you. i was struggling for 40 minutes before I figured out to do this
A shop with saving? Save files and shops should be two seperate video's. Or more, since save files require writing and reading from files and shops require items and currency.
I saw this entire tutorial and did it too..Then i went out.And then all of a suddden i remembered that i forgot to like the video. So here i am rn,i liked and commented too..Your videos are really helpful.I have tried many other video tutorials for unity.BUT U R THE BEST!!!!!
If nothing happens when you click your button, it's because the text is blocking the button. To stop this, go to the button text (TextMeshPro), go under Extra Settings, and turn "Raycast Target" off. I struggled with this, so I hope this helps.
Yes, this helped me! Thanks. Also, for anyone reading this, pushing your button to the bottom of the hierarchy could help too, other UI elements could be blocking your button.
Hello, i have another question: When i drag the "MainMenu" Object in the "OnClick" Thingy i cant select "MainMenu" on the Functions. Only "RectTransform" and "GameObject". Why? Please help me
You need to create an empty object in the scene, put the Main Menu script into the Empty Object, and then drag this Empty Object or the Main Menu script into on click. Basicly you need instantiate the script in the Scene
I had the exact same problem - as I now found out, I dragged the whole "Menu" scene on top level instead of the "MainMenu" object with the menu elements and the script. Try watching 9:38 and take good care which element he actually drags.
@@willichillmann9463 I only dragged "MainMenu" from the Hierarchy and I still don't get the option to select "MainMenu" as the function. Any help on that?
@@memerightsactivist7972 If the "MainMenu" in the Hierarchy has the script for the button attached as a component, you should see see it in the drop-down after dragging the "MainMenu" from the Hierarchy to the playButton. I really hope this helps!
I'm getting this error: Scene with build index: 2 couldn't be loaded because it has not been added to the build settings. To add a scene to the build settings use the menu File->Build Settings... UnityEngine.SceneManagement.SceneManager:LoadScene (int) MainMenu:PlayGame () (at Assets/Scripts/MainMenu.cs:10) UnityEngine.EventSystems.EventSystem:Update () Any help please?
@@maximusjr7550 So I just searched “Bmo 5 minute Unity ui” and found the perfect tutorial so you can combine this vid with that Bmo 5 minute vid. Hope this helped 😊
If any of you have the same problem as me, here ya go: Your image is probably going to be unable to be dragged to the source image, so just click your imported image (to import it just drag it to the assets box) and in the “Texture type” box, select sprite, then click again on the panel, (a window might appear, click confirm or yes whatever it says) and click on the source image and on the circle with a small circle on the right side, click there and the menu should be on the asset.
I have enjoyed your tutorials for a few years, but lately you do them so fast. It looks and sounds like you are in a race to finish in record time, and it's hard to follow along. I still like your tutorials though. :)
La maitre course That's... not true. If he wanted YT money, he would talk much slower, to make his videos longer. Unless I'm "woooosh"-ing, in which case, Pardon.
I kinda like how straight-forward it is. I tend to lose concentration if it's a long video or not even click in the first place. 10-15 videos are perfect for me. If I don't understand something, I just go back and watch again.
Here's some useful code for if you want the text "Loading" to appear while you change scenes: using UnityEngine;using UnityEngine.UI;using UnityEngine.SceneManagement; public class MainMenu : MonoBehaviour { public void Play () { GameObject loading = new GameObject("LoadingText"); loading.transform.SetParent(this.transform); loading.AddComponent().text = "Loading..."; Text loadingText = loading.GetComponent(); loadingText.font = Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font; loadingText.transform.position = new Vector3(522, -21); loadingText.fontSize = 22; loadingText.alignment = TextAnchor.UpperCenter; Instantiate(loading); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); }
@@inigowilloughby7285 Sorry to hear about that, it's just like how you'd add a button or text Game Object just you need to add an Event system object instead. If this is what you've done and you can't find it then I'm not sure what to do, I'm a novice really when it comes to unity I was just relaying what worked for me in my original comment.
Hi. With newer versions of unity, you already have textmesh pro. You will get many errors if you try to download it like you did. Just a heads up. Personaly i think they now should delete the way to import it. Older versions than 18.2 dont get this problem
-Have a video of your desired background and exported is as an mp4. -Open your menu scene in unity -GameObject > Video > Video Player -View your video player in the inspector -Set video clip to your mp4 -Enable looping -Set render camera far plane -Drag in your main camera into the camera slot -Within your video player's inspector click "Add Component" -Type "Rect Transform" -In Rect Transform use the values: POSX: 960 | POSY: 540 | POSZ: 0 (The above assumes a 16:9 aspect ratio) -At the top of the inspector set layer to UI. Hope this helps
Brackeys barely mentions it but he does say his background is a sprite. That's important, you can't just use an image you have to convert it into a sprite. Select your image in your asset list, then in the Inspector at the right click on the the Texture Type drop-down and switch from Default to Sprite (2D and UI).
That means there's a bug in the script, it could be as simple as a missing semicolon or misspelled class name and unity won't use the script. Hope that helps :)
FYI this tutorial still works (in general). There are still a few problems in this tutorial as Unity has updated and things have changed. Here are some problems people seem to be facing with the fixes:
1 - Background Image can't be applied
Select the image from your assets folder and open it in the inspector. Change the texture type from (Default) to (Sprite 2D and UI). It can now be used as an Image in the UI
2 - Game Scene is dark after running Menu Scene
In both scenes go Window > Rendering > Lighting > Scene and at the bottom click on the arrow on the Generate Lighting Tab. Disable (Auto Generate) if it's on, then select Clear Baked Data, then select generate lighting.
3 - TextMeshPro not in asset store
TextMeshPro is now built into Unity and can be used without needing to download further files. It can be used as an alternative to basic (Text).
Thank you this was very helpful.
man doing god’s work over here, tysm
Not all heroes wear capes.
Super! thanks man
thanks man, you helped me with the dark scene lol
There are 3 times you visit a Brackey's tutorial:
The first one is when you copy it.
The second one is when you forget one thing.
The third one is when you show it to a friend.
true af
Why does my MainMenu script not show in "on click" plz help me
Why does my MainMenu script not show in "on click" plz help me
@@dubby7189 put the button as a child in an empty game object called menu, the add menu script to menu
@@Adomas_B what?
0:00 Intoduction
0:12 Canvas and Panels
1:30 Text Mesh Pro
3:10 Colour Gradient
4:00 Text to Button
5:10 Duplicate Button
6:25 Basic Options menu and Slider
8:00 Functionality
10:20 Add Actions to Buttons
good job
Also here is the code if anyone wants to copy paste, but i recommend watching the video its pretty educational
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class mainmenu : MonoBehaviour {
public void PlayGame()
{
SceneManager.LoadScene(1);
}
public void QuitGame ()
{
Debug.Log("QUIT!");
Application.Quit();
}
}
@@ZomBee04 THANK YOU SO MUCH
@@aarona9525 bro its a couple lines of code
@@nugg3tcraft204 it's been 2 months y do you care?
Man, you absolutely saved me for a college project. You're the GOAT of YT, Unity and tutorials!
Thank you! you are always amazing. I took up coding about 2 years ago and then had a baby and put my dreams on hold. Now hes a bit older, I'm less preoccupied with things and want to get back into it. I am so surprised how much I remember and re watching your videos has helped so much. Thank you again!
The best tutorial I've found on the topic so far: exact, clear, condense.
can you find the text mesh folder in unity asset store? i cant find it
@@reyeszenpai7265 As far as I can see, it’s included in unity by default now, see in UI submenu when creating game object
@@KuzmaProDev i had the same problem. it is built in to the unity editor now
I'm actually pretty surprised at how building a game is 20% work and 80% polishing the finer detail.
But polishing the finer details is still work. So it's 100% work.
I hope its like that
for guys who needs help in highlighted color u need to check the image in the bottun setting
@@earthIing he talked about it
@@earthIing 7:55
Not only an options menu, but also making different graphics and resolution of your game for different settings.
Great video, btw
Ico Ivo I suggest you watch sebastian lague or gamegrinds videos on an option menu they are super easy to understand
braceys acidently raps:
"I'm going to make a slider, and make it a bit wider."
LMFAO
he IS actually a raper : }
..and a bit taller
@@dr.kamranhabeeb9969 hes a fuckin what
@@dr.kamranhabeeb9969 umm.. i think u should edit that
Everytime I click a unity tutorial on youtube and Brackeys pops up I feel at ease knowing this is gonna be a good tutorial
Me every time I watch a Brackeys video: "Alright, sounds simple enough"
Also me when I open up Unity: **90s Router Noises** **Stares Blankly**
I have gotten to the point where the word "PLAY" looks weird now, i've been looking at this word for like 3 hours
Dude I feel you xD
Actually the same by me today :)
I did it like in the tutorial but when I start the game I cant click at playbutton and it does not have a dark highlightet area :(
Can u help me?
@@fashlehd6883 Ik same for me
@@fashlehd6883 me too
I am seeing the button play, "PALY" or "YPLA", It's really weird.
have have watched this video like 20 times. and everytime he says his menu is more fun then his game gets me
"I promise you that it will work" those are the words you don't ever say in computer science 😄
Yes
It doesn't make any sense to promise something about codes😂
true!
play.google.com/store/apps/details?id=com.Scripts.Xo.studio
It's the same thing like "I think I'm almost finish" and "It's just a little bug. It's probably a one-liner"
@@thanksfor17ksubscribe32 wth the video is made with Kine Master and its just bad quality... y did u link it?
I for one, personally thank you. I’ve been struggling to create an effective main menu that works. Following your tutorial, has helped me tremendously. You have gained a subscriber.
I was trying to learn some simple unity scripting to show my boss a proposal and nothing made sense or was relevant, but in your video you made it extremely easy to follow along so thank you!
Yes!
Please also do an options menu!
Maybe with graphics options?
please a graphics optings tut, i've been wrecking my brain over it
Check out videos from GameGrind or Sebastian Lague they go over this very nicely
Sparrow, same with me haha!
+thanks Codey!
Mahmoud Shatnawi No problem :)
Totally do this, with graphic options, user input (keyboard/ gamepad binding)
this help me with my college assignment alot, i love brackeys, i dont know why he quit. He is the best person on youtube for unity. He is better then my college course which doesn't teach me how to make a game yet its a games development course. Thankfully I have brackeys!
Maad respect Brackeys, I've been following your videos for 4 years now and I don't even know why I haven't subscribed to you. Subbed!
@Relecent It's too late now, he quit :(
Classic. You follow a simple tutorial, but nothing goes as expected because you're watching it a year late.
Lol it worked for me
@@Bluequaz thanks dude
Worked for me
@@glitchifyed when i put my cursor on the button it doesn't get highlighted please help me??
when i put my cursor on the button it doesn't get highlighted please help me??
HIs tutorials aren't for the absolute beginner who don't want to do any coding but if you aren't that way and know your way around Visual Studio, or some other development platform, you will learn at least 5 cool new things in his quick 10-15 minute tutorials. I'll admit I'm still fairly new to Unity development but I've done a lot of game modding in the past so learning it isn't hard and I love Brackey's tutorials. Quick, to the point, and still very useful and informative.
Great tutorial as always! When I was doing menu switching in my project, I had a separate function that took care of the switching. I didn't think of using it the way you did it. Pretty damn neat. Thanks!
I've watched a 49 minute video and didn't understand anything. In this video every thing makes sense!
Miksaa Right!! Man this channel is so useful! Its crazy how there are so many programmers out there willing to help others, a very unique community.
Where to get that background?
@@alexandrufilipescu1301 I think it's custom created one.
His tutorials are the best
@@miksaa2867 God bless you.
I'm pretty sure tears came out of my eyes when I got to the end of the video.
Thanks so much! :)
If you are confused and can't find TextMesh Pro in the Asset store, it is already included with your version of Unity (This is only included with versions 2018 and higher)
Yess, I wondered about this. Tysm B)
I already know how to make a normal start game/quit game menu, but I never experimented with giving options functionality. Next tutorial a functional option menu would be a great idea :D
Love the vids btw
Jasperkiller1 yes
my buttons don't find the "main menu game object" do you know how to fix that?
6 years later and these tutorials are still the best I've seen
Another great tutorial! I'll definitely implement something like this in my project. These are very concise and easy to understand. How long have you been working with Unity? It seems like you know almost everything about the software.
I would love an options menu tutorial, and I think these are the things you should cover in it:
- Resolution
- Volume (and how to separate music volume and effects volume)
- Graphics options
- Mouse sensitivity
I would also like a tutorial for key binds but I think thats a bit more advanced.
Love your videos!
Ik im late... Like really late. But in his simple game tutorial episodes if you watched it through he shows how to make a move you left and d move you right, you could improvise a little on the code and you would be able to make say L enable a colour change on your player, or obstacle for example. Im sure you know this, but this link docs.unity3d.com/ScriptReference/
Shows you pretty much if not all codes you can use in unity, on the left just click UnityEngine if thats what you are using and then go from there! Good luck!
Its Been 4 Years and this still works. Great job Brackeys!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class NewBehaviourScript : MonoBehaviour {
public void PlayGame ()
{
SceneManager.LoadScene (SceneManager.GetActiveScene ().buildIndex + 1);
}
public void QuitGame ()
{
Debug.Log ("QUIT!");
Application.Quit();
}
}
Thanks! But it is not very complicated, I do not think this was necessary.
@@hadoom848 complicated? (s)he did it to save us time
Thank you so much
Thank You!
you are legend you save my time thx so mush
This was super great! Clear, concise, easy to follow, and exactly what I needed to learn. Thanks!!!
This channel is the best. Really miss they stopped making new content.
Sir you are the best man on earth so amazing videos
My whole summer vacations have become fruitfull only because you
Thank You
Soon supporting you on Paetron...❤❤
Anyone using this guide in 2021 or later: You will probably get a SceneManagement error in your Unity Compiler following this guide. First be sure to download the latest version of Microsoft Visual Studio, next be sure to select "Game Development with Unity" when installing, and if you did not just go to Modify to add the version.
Finally and most importantly be sure to in Unity go to Edit>Preferences and select your version of MVS as the preferred editor and if you need to set the compiler check box on. Later version of Unity do not seem to use compiler check box on though.
After that you should be golden and can continue to follow this guide.
How do i go to Modify to add the version?
For those saying that the highlighting doesn't work, make sure you have the EventSystem active in the canvas.
Thanks for the video, cheers
Just quick thing:
Error: button stays highlighted after clicking it.
Solution: change navigation to "none".
OHH thanks !! :)
Thanks Bro!
DUUDDEEEE YES
You saved my life xD
you're not the hero we deserve... you're the hero we need
YEEEEES IT WORKS! I'm sit 4 hours here before i found the problem! THANKS!!!!
can you help me? when I play the game, the game load scene 2 instead of main menu, I've make sure that following the tutorial step by step
Nerd Addict In your build index do you have The Menu over the Game Scene? 9:16
PLEASE HELP, I DO NOT HAVE THE CHECKBOX, SO I CAN NOT MAKE IT TRUE OR FALSE IN ONCLICK()
WHAT SHOULD I DO TO MAKE IT VISIBLE?????? THANK YOU.
well the text doesnt show up, awesome! what a happy moment! i did not break my keyboard trying to fix this!
Thank you so much!
RIP Brackeys. You will be missed.. :(
is he dead?
@@laslodes2550 well his channel is because he stopped it
Does this work on the newest Unity version?
@@FortniteBalls9669 It works with the latest version. You don't have to import the TMP, Unity has it by default now
@@bluerhino1046 HE's BACK WITH GODOT! CHECK HIS LATEST VIDEOS
You are the best tutorial based youtuber i have encountered. You know how to make complex programming projects and neat coding that i have been looking for, for days. I wish you well and a brilliant career :), subscribed :)
aaa I wait this tuto for a long time 🔥 and I like the new color for your logo
Yasser Sedrati it actually reminds me of his first old logos with the banner and everything maybe he did that on purpose and it's a anniversary or something?
The logo reminds me of the Instagram logo xD
Plofgans yeah true 😂
Yasser Sedrati Hey
hey guys do you know how to import scene to another scene?
I was doing the tutorial when at 9:44 he added the function PlayGams, I double checked my code and it was the exact same as his except some messages weren’t colored the same as his (my MainMenu was geek instead of orange, my monobehavior was white instead of orange, my PlayGame was yellow instead of white, and both of my scenemanagers at the bottom were white instead of orange) can someone please help me fix this.
Me too but colour were same
Did u write that using statement?
i'm not sure if color means much, it may just have been an update to the software.
Gh Dr cjxhicyd Ff yes
You actually helped me a lot. I'm new to unity and I'm really glad you did this. Hope all good to you
Before watching Brackeys : *spends 3 hours to make a single menu button*
After watching Brackeys : "finishes the Menu in just 15 mins*
true
For anyone who cant find TextMeshPro -
Window -> TextMeshPro -> Import TMP Essential Resources
Its built in already!
ohhhhh thanks
You saved me thanks so much man
I've made Jumpy Cube game with the help of Brackeys videos. Such a nice guy to share all his skills with us.
For those who, like me, had a "no function" in the dropdown list of the On Click () behavior, here is what to do:
1) When you created you UI, Unity created a GameObject called "EventSystem".
2) Select "EventSystem" and attach the MainMenu script
3) In the PlayButton and QuitButton, instead of attaching the MainMenu script on the On Click () behavior, attach the "EventSystem" object
4) Now it will show the functions correctly in the dropdown list :)
Thanks a lot!!!
Bless your soul XD
It shows game object, transform, event system, stand-aloneinput module. It does show my main menu script😔
Still didn't work for me ,, the playgame function doesn't show
I just wanna say that its necessary to have the event system in your canvas, otherwise the button actions wont work i just had a problem when my button didnt work entirely when i deleted the event system , if u already did delete it go to create > UI >event system (Hope this helps someone).
YOU SAVED ME! I Spent too much time thinking why my button action doesn't work at all. But now it's working fine. Thank you so much!
Yoooo thank you i didnt know
THANK YOU SO MUCH
i scaled up my background and made an animation for it to sway and slapped on some lemmino music. holy MOLY is my game looking good! cant wait to release it! thank you brackeys for everything you've done for us! youre the reason i can actually be a game dev
can you please make a video on how to make a full options menu with like resolution, graphics, working volume changer for all scenes, controls, etc. Thank You! This video was amazing and really helpful!
Might be like 10 mins or 20 at most
Check out Unity's default FPS 3D game, I beleive it has it in there you can learn from
'public void PlayGame ()' if you do not have the PlayGame function, then you should remove the space in the code like this 'public void PlayGame()'. If you get errors then you probably didn't add 'using UnityEngine.SceneManagement;' to the very top of the code (maybe it will help someone)
This helped a lot, couldn’t find why I was having errors. Thank you!
One of the best programming tutorials I've ever seen. Great work!
UPDATE: If it's not working at all, you might be using the new Input System instead of the Legacy one. Check that (Project Settings -> Player -> Active Input Handling), and if you are, make sure your Event System is updated, containing the new InputSystemUIInputModule. Then apply your inputs in the Actions Asset and assign the inputs to the events ("point", "left click", "submit", etc.). That solved it for me.
im in the player section but cant find the active input handling thing
I can't find TextMesh Pro: default backend - 404
Edit: TextMesh Pro is now by default into Unity
Very late and also I never leave TH-cam comments but I had to for this one - I am a fairly experienced programmer and even I spent an embarrassing amount trying to figure this out. Video solved it for me in ten minutes you are a God sir
Me: Makes A great Game In Unity
EventSystem: *No way*
PLEASE HELP, I DO NOT HAVE THE CHECKBOX, SO I CAN NOT MAKE IT TRUE OR FALSE IN ONCLICK()
WHAT SHOULD I DO TO MAKE IT VISIBLE?????? THANK YOU.
@@LeHalazoone You need to make the play, settings, quit as a button
@@obc257 Please show me, i do not know how to do it :)
@@LeHalazoone Same
@@danzy182 How did you fixed it? Thanks :) can you see the checkbox?
too the 2 peopel that have the same problem as me where the buttons wont even highlight, make the eventsystem a child of your canvas, then look at the component. if the input system seems to have an error LOOK AT IT it will tell you to update the input system with a very handy button below that to do it for you. i was struggling for 40 minutes before I figured out to do this
Bloody fucking lad right here, major props my dude... also when typing this it's at two likes so bravo
I am new to Unity, actually a noob. However the series are quite helpful and very detailed in teaching proficiency. Interesting
me: copies start code
Unity:ERROR GO BRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
Please make a tutorial on how to make a shop with SAVING pls 😊
A shop with saving? Save files and shops should be two seperate video's. Or more, since save files require writing and reading from files and shops require items and currency.
kje si nigga...
Leon Čepin You should first learn how to save an read data. Then to make a shop.
OMG Please. I NEED THIS. All the tutorials I have found describe it in such a vague way and I can never seem to get it right on my own.
Just use a scriptable object
I saw this entire tutorial and did it too..Then i went out.And then all of a suddden i remembered that i forgot to like the video. So here i am rn,i liked and commented too..Your videos are really helpful.I have tried many other video tutorials for unity.BUT U R THE BEST!!!!!
If nothing happens when you click your button, it's because the text is blocking the button. To stop this, go to the button text (TextMeshPro), go under Extra Settings, and turn "Raycast Target" off.
I struggled with this, so I hope this helps.
Yes, this helped me! Thanks. Also, for anyone reading this, pushing your button to the bottom of the hierarchy could help too, other UI elements could be blocking your button.
Thank you!
Thank you so much!! This frustrated me for a while until i found your comment :) :) :)
My goodness, I love you! Thank you!
1:56 When I tried doing this, it asks me to import the TMP essentials, examples and extras. But I can't click on the import buttons though.
Problem solved, if you are also having this issue, go to Window in the toolbar and form there TextMesh Pro->Import essentials
@@DavidBrit101 thanks
@@AtomStudiosFX You're welcome :)
Thanks a lot!
Hello, i have another question: When i drag the "MainMenu" Object in the "OnClick" Thingy i cant select "MainMenu" on the Functions. Only "RectTransform" and "GameObject". Why? Please help me
You need to create an empty object in the scene, put the Main Menu script into the Empty Object, and then drag this Empty Object or the Main Menu script into on click. Basicly you need instantiate the script in the Scene
when i want to select the script in the playbutton it did not pop up only transform and game object.
pls help
Same for me
please someone help
@@golden_apple_ Yes someone pls help.
@@bluesyntax5355 Help also maybe idk
LOVE THIS!.. got into some problems and had a hard time but at least works better than most youtubers
On the Scipt Button menu, when I have to choose which function I want to run, the only option that shows up is "string name", why does it happen?
Maybe you forgot to make the method public
I had the exact same problem - as I now found out, I dragged the whole "Menu" scene on top level instead of the "MainMenu" object with the menu elements and the script. Try watching 9:38 and take good care which element he actually drags.
@@willichillmann9463 I only dragged "MainMenu" from the Hierarchy and I still don't get the option to select "MainMenu" as the function. Any help on that?
@@memerightsactivist7972 If the "MainMenu" in the Hierarchy has the script for the button attached as a component, you should see see it in the drop-down after dragging the "MainMenu" from the Hierarchy to the playButton. I really hope this helps!
I'm getting this error: Scene with build index: 2 couldn't be loaded because it has not been added to the build settings.
To add a scene to the build settings use the menu File->Build Settings...
UnityEngine.SceneManagement.SceneManager:LoadScene (int)
MainMenu:PlayGame () (at Assets/Scripts/MainMenu.cs:10)
UnityEngine.EventSystems.EventSystem:Update ()
Any help please?
I have the same error🥲
@@maximusjr7550 So I just searched “Bmo 5 minute Unity ui” and found the perfect tutorial so you can combine this vid with that Bmo 5 minute vid. Hope this helped 😊
@@FortniteBalls9669 thanks bro ✌
Im getting this error:scenemangement does not found in namespace 'unity engine' what should i do
@@odev8667 look at my comment above. This brackeys vid is outdated
Great tutorial and love that you explain things on the go, it was a little hard to keep up with your pace. Keep up the good work
If any of you have the same problem as me, here ya go: Your image is probably going to be unable to be dragged to the source image, so just click your imported image (to import it just drag it to the assets box) and in the “Texture type” box, select sprite, then click again on the panel, (a window might appear, click confirm or yes whatever it says) and click on the source image and on the circle with a small circle on the right side, click there and the menu should be on the asset.
Hey Man, thanks.
I have enjoyed your tutorials for a few years, but lately you do them so fast. It looks and sounds like you are in a race to finish in record time, and it's hard to follow along. I still like your tutorials though. :)
true
La maitre course That's... not true. If he wanted YT money, he would talk much slower, to make his videos longer. Unless I'm "woooosh"-ing, in which case, Pardon.
I kinda like how straight-forward it is. I tend to lose concentration if it's a long video or not even click in the first place. 10-15 videos are perfect for me. If I don't understand something, I just go back and watch again.
Videos come with a sweet option called pause ...
XD@@comatose9907
That was the best unity tutorial I have used in the entire youtube. Thank you very much!
btw I am so horrible, that I watched it for 2 hours... 13 minutes for 2 hours.
Here's some useful code for if you want the text "Loading" to appear while you change scenes:
using UnityEngine;using UnityEngine.UI;using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour {
public void Play () {
GameObject loading = new GameObject("LoadingText");
loading.transform.SetParent(this.transform);
loading.AddComponent().text = "Loading...";
Text loadingText = loading.GetComponent();
loadingText.font = Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font;
loadingText.transform.position = new Vector3(522, -21);
loadingText.fontSize = 22;
loadingText.alignment = TextAnchor.UpperCenter;
Instantiate(loading);
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
It doesn't do anything mate
@@necrago it does, mine shows up in the bottom right of the window when clicking play
For anyone whose button isn't highlighting on hover or click, try adding a "UI -> Event System" to the menu scene.
@@inigowilloughby7285 Sorry to hear about that, it's just like how you'd add a button or text Game Object just you need to add an Event system object instead. If this is what you've done and you can't find it then I'm not sure what to do, I'm a novice really when it comes to unity I was just relaying what worked for me in my original comment.
@@alasdairingham2095 thank you so much you saved me
wonderful, I deleted that one. Thank you so much!
Thank you! This is my first time making a game and all your videos have been very helpful.
im having an issue. I cant interact with my menu at all!
EDIT: nvm, aparently i needed an event system in my canvas
CL3NR c 2 you just saved me from a life of pain, thanks
Edit: I subbed because you gave my life meaning 😊
This needs to be the top comment! TYSM!
Thanks for making me write my first line of code! There´s a long way ahead lol.
I'm watching this @2x and it's very coherent. Huge respect to you!
"Lets make this slider wider..."
Big Brack 2020
Oh my boy Big brack
more like T H I C C
@@gleqy please say that was a dani reference...
My text disappears when I duplicate the menu. Does anyone know how to fix this?
move it in front of the panel/canvas in 3d mode
Man, its just awesome. your work is fantastic simples a accurated.
TH-cam you miss you and your content of unity features
9:40 i dont find the function playGame :(
same
Is the function playGame public? If not make it public.
Hello, I Wanted To Ask You How Can I Make An Outline Of An Object If It's Behind A Wall
Thanks
Thanks for the tutorial, I was freaking out. When I saw your video, I finally maked my game main menu
Like yor new logo!
Hi. With newer versions of unity, you already have textmesh pro. You will get many errors if you try to download it like you did. Just a heads up. Personaly i think they now should delete the way to import it. Older versions than 18.2 dont get this problem
you right
they wont delete the import for a while cause a lot of people are still running older versions of unity
Maybe getting a warnong would be smart🤔🤔
Warning**
Its worth noting that TextMeshPro comes as standard with newer versions of Unity!, check your packages folder for 'TextMeshPro'
why in the unity 2019.3.3fi , script (Scene Management) error Missing from the Unity engine
Same
Hey, Brackeys love your tutorials man! But sometimes I can't see my menu text neither in Scene nor in Game. I'm new to Unity. Am I missing something?
You have the best Unity tutorials on TH-cam, this video really helped!
from where you got the Textmesh pro? the link is not working or you dont used it?
"the menu may be more fun than the game rn"
NAH i like looking at plain black screens with small white text all day long...I got really good at it :D
Ik it's like 2 years later but I would really like to know how I can make a background that moves ?
-Have a video of your desired background and exported is as an mp4.
-Open your menu scene in unity
-GameObject > Video > Video Player
-View your video player in the inspector
-Set video clip to your mp4
-Enable looping
-Set render camera far plane
-Drag in your main camera into the camera slot
-Within your video player's inspector click "Add Component"
-Type "Rect Transform"
-In Rect Transform use the values: POSX: 960 | POSY: 540 | POSZ: 0
(The above assumes a 16:9 aspect ratio)
-At the top of the inspector set layer to UI.
Hope this helps
I just animated it
@@TehYosher thanks man even tho im 1 year later
This was a great guide by the way :) Found it MUCH easier to follow compared to others I've tried watching on Unity UI :D
0:40
I’m already confused
Whats so confusing?
@@Jackster8484 cant drag the background over
@@harrisonsmithers2344 did you end up finding a fix for this issue?
Brackeys barely mentions it but he does say his background is a sprite. That's important, you can't just use an image you have to convert it into a sprite. Select your image in your asset list, then in the Inspector at the right click on the the Texture Type drop-down and switch from Default to Sprite (2D and UI).
@@stephen-macdonald when i select my image the inspector shows nothing
on my Unity the "PlayGame()" function does not appear on the "MainMenu" function inside the On click... Have no idea why can someone help please
That means there's a bug in the script, it could be as simple as a missing semicolon or misspelled class name and unity won't use the script. Hope that helps :)
drag THE MAINMENU gameobject, not the script in your project
did you make PlayGame() public?
I was Missing a ; fixed it for me
I have everything done right and same problem
Thank you this helps so much. its going to be a sad day when these tutorials are out of date
My button disappears when I play the game
I was able to fix but I am extremely sorry to say that I have no clue how I did it,
sounds like Unity xD
things get fixed: no idea how/why
things break: no idea how/why
лох
"THIS IS A GAME" 😂
Sandbox Animations Ikr, like how he put it in all caps like, T H I S. I S. A. G A M E.
AND A GAME!
:)
Sandbox Animations be.
This is a undeveloped game that needs more funding. Help him on patreon