Unity Button Tutorial
HTML-код
- Опубликовано: 2 июн 2024
- It's hard to think of any game that's worth mentioning which doesn't make use of buttons. Whether they're being used to navigate around menus, between scenes, to buy items at shops, count clicks, or progress dialogue, buttons are a cornerstone in video games. In a previous video, we went over how to create UI in unity. In that video, we created some buttons but didn't talk much about the button component or assign any functionality to them. In this video, we'll detail the button component and create two different functions for our buttons, one to change scenes, and one to quit.
► Socials
Twitter: / the_real_aia
Discord: / discord
My free web games: aiadev.fun/
► Get the script: unicornone.gumroad.com/l/butt...
► Unity UI Tutorial: • Unity UI Tutorial | An...
► Button Navigation: • Controller and Keyboar...
► Download Unity 3D: on.unity.com/3cbxhXY
For more educational content on video game development, unity tutorials, and c# programming don't forget to subscribe!
Chapters:
0:00 Introduction
0:41 Understanding the button component
2:27 Creating a C# script with button functions
4:50 Assigning Button OnClick functions
7:20 Testing the buttons
7:44 Outro
····················································································
****
Get a 90% discount on a .fun domain for one year on www.get.fun using the coupon “AIA”
****
♪
#unity3d #unitytutorial #gamedev
Having trouble with anything in unity? Let me know what you'd like to see a tutorial about next.
there is an error on Line 6, LoadScene("sceneName"); my app is saying I should use UnloadScene.
me butters don't show up
Wow, I finally understand how the button system works, thank you for the in depth tutorial
Oh my gosh thank you so much for this tutorial series. It has helped me so much with my game!
This is the best tutorial I have ever seen ! Thank you so much!!
This worked! The function wasn't showing up when I put the script in, but when I put the object in, it worked. Thanks!
You're welcome :)
Every Serialized Field (those fields we can drag things into) has a Type written in the parentheses on its right.
If you see like:
Thing (Object)
That means that field expects you to put an Object into it.
Same goes for every type. If it expects a Transform, it will show "Thing (Transform)", if it expects a RigidBody, it will show "Thing (RigidBody)", etc.
I don't know, maybe you have already figured this out, but it might help someone idk
Oh one more example:
If the Serialized Field expects a specific component, you can also drag and drop an *Object* that contains that component, and then that object's *component* will be assigned. 😉
Thank you, this was really easy to follow, keep up the good work!
Glad it helped!
Thank you so much for this tutorial
Thanks this help so much!
Thank you, mate. You saved my life. 💯🙏
nice button tutorial
I am getting the error of script class cannot be found. May I as for any suggestions again ?
Thank you so much. I know how to make games and code but only in Visual Scripting. After discovering how bad the performance is with Visual Scripting, I'm switching to C# coding and now I have to relearn 95% of everything again
THANKYOU!
I'm more curious about your code for your character/player movement in that platform game. A recent tutorial I did used the physics engine and applied force to the rigidbody2D but that was NOT a good movement for platformers. Your game has excellent movement from what I saw and that is what I want to learn how to do properly.
Thanks for this video and can you make video about quit game
Спасибо за видео, было полезно, я узнал много нового.
What's the game at 0:29?
well, all that I have learned is that "public class" deosn't mean that all is public
Unity could have made this process much better.
What would you suggest? I’ve got some Unity contacts