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

Комментарии • 26

  • @AIAdev
    @AIAdev  2 года назад +8

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

    • @edoardo_maresca
      @edoardo_maresca 10 месяцев назад

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

    • @NinjaKnight612
      @NinjaKnight612 3 месяца назад

      me butters don't show up

  • @BlandBucket
    @BlandBucket Месяц назад +1

    Wow, I finally understand how the button system works, thank you for the in depth tutorial

  • @jakproductions94
    @jakproductions94 Год назад +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 10 месяцев назад +1

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

  • @theenten4579
    @theenten4579 2 года назад +4

    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  2 года назад +1

      You're welcome :)

    • @arthurpaixao4132
      @arthurpaixao4132 Год назад +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 Год назад

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

  • @hologrammaster2468
    @hologrammaster2468 2 года назад +5

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

    • @AIAdev
      @AIAdev  2 года назад

      Glad it helped!

  • @korbyntalks
    @korbyntalks Год назад +2

    Thank you so much for this tutorial

  • @Skitozzz
    @Skitozzz Год назад +3

    Thanks this help so much!

  • @polasbeatz
    @polasbeatz Месяц назад

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

  • @tunaosu
    @tunaosu Месяц назад

    nice button tutorial

  • @faiksami94
    @faiksami94 Год назад +1

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

  • @DARK_AMBIGUOUS
    @DARK_AMBIGUOUS 8 месяцев назад

    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

  • @user-ki2lf4yx1e
    @user-ki2lf4yx1e Год назад +1

    THANKYOU!

  • @fictitiousnightmares
    @fictitiousnightmares 7 дней назад

    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.

  • @zylorixus
    @zylorixus 2 года назад +3

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

  • @user-ck5ee4mo8b
    @user-ck5ee4mo8b 6 месяцев назад

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

  • @fandeBuzz
    @fandeBuzz Год назад +1

    What's the game at 0:29?

  • @atreidesson
    @atreidesson 11 месяцев назад

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

  • @kenamia9136
    @kenamia9136 Год назад +1

    Unity could have made this process much better.

    • @AIAdev
      @AIAdev  Год назад +1

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