Unity Button Tutorial

Sdílet
Vložit
  • čas přidán 13. 06. 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

Komentáře • 26

  • @AIAdev
    @AIAdev  Před 2 lety +7

    Having trouble with anything in unity? Let me know what you'd like to see a tutorial about next.

    • @edoardo_maresca
      @edoardo_maresca Před 10 měsíci

      there is an error on Line 6, LoadScene("sceneName"); my app is saying I should use UnloadScene.

    • @NinjaKnight612
      @NinjaKnight612 Před 3 měsíci

      me butters don't show up

  • @theenten4579
    @theenten4579 Před 2 lety +5

    This worked! The function wasn't showing up when I put the script in, but when I put the object in, it worked. Thanks!

    • @AIAdev
      @AIAdev  Před 2 lety +1

      You're welcome :)

    • @arthurpaixao4132
      @arthurpaixao4132 Před rokem +1

      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

    • @arthurpaixao4132
      @arthurpaixao4132 Před rokem

      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. 😉

  • @jakproductions94
    @jakproductions94 Před rokem +3

    Oh my gosh thank you so much for this tutorial series. It has helped me so much with my game!

  • @amosf.2780
    @amosf.2780 Před 11 měsíci +1

    This is the best tutorial I have ever seen ! Thank you so much!!

  • @hologrammaster2468
    @hologrammaster2468 Před 2 lety +5

    Thank you, this was really easy to follow, keep up the good work!

  • @khiaralas8378
    @khiaralas8378 Před 9 dny

    This is so great! Thank you for this

  • @korbyntalks
    @korbyntalks Před rokem +2

    Thank you so much for this tutorial

  • @polasbeatz
    @polasbeatz Před měsícem

    Thank you, mate. You saved my life. 💯🙏

  • @Skitozzz
    @Skitozzz Před rokem +3

    Thanks this help so much!

  • @tunaosu
    @tunaosu Před měsícem

    nice button tutorial

  • @user-ki2lf4yx1e
    @user-ki2lf4yx1e Před rokem +1

    THANKYOU!

  • @DARK_AMBIGUOUS
    @DARK_AMBIGUOUS Před 9 měsíci

    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

  • @zylorixus
    @zylorixus Před 2 lety +3

    Thanks for this video and can you make video about quit game

  • @faiksami94
    @faiksami94 Před rokem +1

    I am getting the error of script class cannot be found. May I as for any suggestions again ?

  • @fictitiousnightmares
    @fictitiousnightmares Před 18 dny

    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.

  • @user-ck5ee4mo8b
    @user-ck5ee4mo8b Před 7 měsíci

    Спасибо за видео, было полезно, я узнал много нового.

  • @fandeBuzz
    @fandeBuzz Před rokem +1

    What's the game at 0:29?

  • @atreidesson
    @atreidesson Před 11 měsíci

    well, all that I have learned is that "public class" deosn't mean that all is public

  • @kenamia9136
    @kenamia9136 Před rokem +1

    Unity could have made this process much better.

    • @AIAdev
      @AIAdev  Před rokem +1

      What would you suggest? I’ve got some Unity contacts