Creating a Custom Tab System in Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ต.ค. 2024

ความคิดเห็น • 225

  • @BlakeGillman
    @BlakeGillman 3 ปีที่แล้ว +22

    I didn't even need to watch the video, just seeing the title made me realize I needed something I didn't have before. I always just programmed tabs separately depending on what system I'm making, it never even occurred to me just to make a generic tab system lol. I should do that.

  • @buzz1ebee
    @buzz1ebee 4 ปีที่แล้ว +32

    Really good tutorial. Straight to the point whilst not missing out on any explanations. Instant subscribe. Keep up the good work!

  •  4 ปีที่แล้ว +27

    This is... amazing. So clear and direct to target. You are the master dude. Instant sub!

  • @PyroOfZen
    @PyroOfZen 4 ปีที่แล้ว +163

    "You could do this manually with buttons, but that's tedious" *recreates buttons from scratch*

    • @SaiCharanKommana
      @SaiCharanKommana 3 ปีที่แล้ว +3

      Exactly...

    • @myriadtechrepair1191
      @myriadtechrepair1191 3 ปีที่แล้ว +30

      Recreating only the functionality you need in a way that scales better is the hallmark of a good system's engineer.

    • @manavarora7644
      @manavarora7644 3 ปีที่แล้ว +4

      @@myriadtechrepair1191 TRUE.

    • @bodietripp8218
      @bodietripp8218 3 ปีที่แล้ว +1

      I guess Im randomly asking but does anyone know a trick to get back into an instagram account?
      I somehow forgot the login password. I would love any tricks you can offer me!

    • @nilla_studios
      @nilla_studios 2 ปีที่แล้ว

      + can't navigate using keyboard

  • @학습-m7e
    @학습-m7e 2 ปีที่แล้ว

    I was stuck with creating tabs in Unity, but this well-organized tutorial helped me.

  • @chakanshu
    @chakanshu 7 หลายเดือนก่อน +1

    Things free on youtube not on unity X| huh. Thanks so much matt yes? I've been watching your videos and learning so much and my boss is really impressed with me because of these solutions.

  • @jdmozo
    @jdmozo 4 ปีที่แล้ว +7

    Man you're a genius, I'm lucky to find your channel!!! Thanks a lot for the tutorial!

  • @RiorXD
    @RiorXD 4 ปีที่แล้ว +218

    Hold the phone.... 3:00all the years ive been using unity and i Never knew you could change the icon of the scripts and objects.....

    • @besportscrazy
      @besportscrazy 4 ปีที่แล้ว +4

      5.5+ and still didn't know :D

    • @FireJojoBoy
      @FireJojoBoy 4 ปีที่แล้ว +8

      Ikr this is so usefull and professional

    • @martin-gaming
      @martin-gaming 4 ปีที่แล้ว

      same

    • @chrheca
      @chrheca 4 ปีที่แล้ว

      WOT DA HELL

    • @breakfastboi3344
      @breakfastboi3344 4 ปีที่แล้ว

      I’ve basically anyways knew it

  • @rimoldi98
    @rimoldi98 5 ปีที่แล้ว +39

    Great vid! Found you out through reddit and damn... You need more subs dude, great quality and very well explained, learned a lot with it, keep up!

    • @MassimoRough
      @MassimoRough 4 ปีที่แล้ว +1

      Don't hesitate to share the video on your social media, this way you will help getting more subs to dude.

    • @CraftBasti
      @CraftBasti 4 ปีที่แล้ว

      Where in reddit did you find him?

  • @davidsesto1224
    @davidsesto1224 4 ปีที่แล้ว +13

    Amazing video! I love how you explain everything in such a way that can be abstracted and used in different contexts, not with the specific use of the demo in your videos.
    In case anyone is having trouble with the trigger of OnPointerClick (both OnPointerEnter and OnPointerExit work for me, but OnPointerClick does), I've read on other sites that adding a Button to the Tabs could solve the issue. It does for me, although I still do not understand why the two first events work, while the third doesn't.

    • @egamer8116
      @egamer8116 4 ปีที่แล้ว

      I had the same problem ! I've tried everything on internet to fix it and it still not working. but After some test, I found out that It was the UI's (or images layers) problem, the OnPointerClick function works after I replace tab buttons.

  • @nemlinkacompany7577
    @nemlinkacompany7577 5 ปีที่แล้ว +4

    Again amazing, I love all your content and this one helped me strait away. I found few "make your tab" tutorial, but after seeing your, I had to change whole logic, because it is much more clear, and feel really profesional.
    I hope your views will skyrocket because there is few channel with such heigh quality tutorials.
    Wish you the best. And many thanks for any of yours video

  • @TheErusPrime
    @TheErusPrime 2 ปีที่แล้ว

    This is exactly what I needed for my generic table top character builder and tracker. Thank you

  • @LuRybz
    @LuRybz 4 ปีที่แล้ว +4

    Man, this is amazing.
    Really cool and organized way of doing this.
    God Bless you and thank you for such content.

  • @TheNamesJT
    @TheNamesJT 4 ปีที่แล้ว +7

    Yeah, I have watched many unity tutorials trying to learn c# watch the beginners/intermedia and advanced unity c# playlists and other TH-camrs unity based c# playlists even purchased some Udemy course on unity and still would have never been able to think about doing this.

    • @joelperpetua3929
      @joelperpetua3929 4 ปีที่แล้ว

      Knowing a programming language does not imply knowing how to program

    • @dormitando
      @dormitando 3 หลายเดือนก่อน

      @@joelperpetua3929 its been 4 years, did u already figure out the difference between a language and a framework?

  • @storiesstrauss
    @storiesstrauss 3 ปีที่แล้ว +1

    Your tutorials are awesome! I really enjoy your thought process and how articulate you are when explaining it.

  • @eggsareliquidchicken
    @eggsareliquidchicken 2 ปีที่แล้ว +1

    Great video! I'm making my own UI toolkit and your videos have been really useful.

  • @Ophelos
    @Ophelos 5 ปีที่แล้ว

    I know that this video is a few months old now, but you got a new sub because of it.

  • @Assasin1618
    @Assasin1618 5 ปีที่แล้ว

    I am so glad this was in my recommended! So much better than most tutorial videos on game dev around TH-cam. Keep it up!

  • @TheHyvin
    @TheHyvin 2 ปีที่แล้ว

    Great video. Quite refreshing to see some well organized code that doesn't feel hacked together. I subscribed in hopes of seeing more like this.

  • @paulwolf8799
    @paulwolf8799 9 หลายเดือนก่อน

    May you get a gazzilion subscribers, this is priceless.

  • @hernandonj
    @hernandonj 3 ปีที่แล้ว

    Wonderful video. Precise, direct, focused, lean, and very well explained. Thanks a lot!

  • @wanderergrim
    @wanderergrim 2 ปีที่แล้ว

    Thank you this video was extremely helpful as I am making a game for my final year project of my Computing Degree

  • @jxvisn8551
    @jxvisn8551 5 ปีที่แล้ว +3

    This... this content I like :D. Great video man

  • @nericarcasci9919
    @nericarcasci9919 3 ปีที่แล้ว

    Your tutorials are always so clear, keep it up man!!

  • @Dymangel
    @Dymangel 4 ปีที่แล้ว +1

    Ok nice tutorial, you have my like. This helped me to make something rly simple in the UI

  • @BlueGooGames
    @BlueGooGames 4 ปีที่แล้ว

    Perfect, thanks a lot! The small little trick with using an image in an event to turn it on and off was great. Now the main menu of Space Chef is starting to look and work really well! :)

  • @RealFakePhD
    @RealFakePhD 2 ปีที่แล้ว

    this is slick. great work partner

  • @error04
    @error04 4 ปีที่แล้ว

    Whyyyyy do you have so few followers??Your videos are really great and useful. I wish you a speedy prosperity of your channel, you clearly deserve it!

  • @TipToeTiger
    @TipToeTiger 4 ปีที่แล้ว +1

    Great tutorial, really appreciate the effort you put in. Keep it up!

  • @jiehongjiang5826
    @jiehongjiang5826 4 ปีที่แล้ว

    This channel deserves more subscribers!

  • @KhrisKruel
    @KhrisKruel 5 ปีที่แล้ว

    hey man, great guide! Looking forward to more stuff. While I might know how to do basic things, the way you go about things brings a lot of ideas and new ways of thinking to solve my game dev problems, and is a lot cleaner as well.

  • @CodemasterJamal
    @CodemasterJamal 4 ปีที่แล้ว

    Wow, this is a really useful script. It can be used in different projects rather easily.

  • @themirlabs
    @themirlabs 2 ปีที่แล้ว +1

    This is a very clean system. i really like it. Only issue i have is there is allot of public variables and funcs. allot of them could be private or [serilizedfield] private.
    Other then that im subbing for more.

  • @Gathrey
    @Gathrey 5 ปีที่แล้ว

    This video is great! Hoping for more tutorials :) Definitely right up there when it comes to clear and concise explanation and format. SUBSCRIBED!

  • @farvardinmainyu1961
    @farvardinmainyu1961 4 ปีที่แล้ว

    It's Quite really good! The code is simple and clean.

  • @daicarft1765
    @daicarft1765 3 หลายเดือนก่อน

    thank you for the video really healped me out

  • @thepolygonpilgrimage
    @thepolygonpilgrimage 5 ปีที่แล้ว +2

    Another beautifully explained and well paced guide. Excellent work! I'd like to reach out and see if we can collaborate on something. You deserve WAY more subscribers for this hard work and solid content.

  • @Arrow5587
    @Arrow5587 5 ปีที่แล้ว

    Thank you for making such high quality contents. Huge Respect.😊

  • @my_namejeff9770
    @my_namejeff9770 4 ปีที่แล้ว

    this looks like magic. great video btw..

  • @ChrisNoeth
    @ChrisNoeth 2 ปีที่แล้ว

    This was really helpful! Thank you! :)

  • @MansGottaCode
    @MansGottaCode ปีที่แล้ว

    Outstanding. Thank you so much!

  • @thiagobr12
    @thiagobr12 4 ปีที่แล้ว

    Thank you so much for this awesome video! Helped me a lot

  • @rodrigomulinarioramos7504
    @rodrigomulinarioramos7504 2 ปีที่แล้ว

    Ohhh I was really looking for the first type of tab! hahaha

  • @gustavo.saraiva
    @gustavo.saraiva 5 ปีที่แล้ว

    Guy this videos is awesome, congrats 👏👏👏

  • @tranvilap4713
    @tranvilap4713 5 ปีที่แล้ว

    This was great, you deserve more subscribes. keep up!!!!

    • @MassimoRough
      @MassimoRough 4 ปีที่แล้ว

      If you want to bring more subscribers and not only point out to low count you could, well, share this video for example ☺

  • @maxbauerv
    @maxbauerv 2 ปีที่แล้ว

    Thank you so much! Great tutorial

  • @victormr1601
    @victormr1601 3 ปีที่แล้ว

    This was very helpful, thanks!!

  • @irfanyigitbaysal7894
    @irfanyigitbaysal7894 4 ปีที่แล้ว

    you deserve more than 25k subscriber

  • @b3dsign
    @b3dsign 2 ปีที่แล้ว +2

    Like some here I have no idea what happens on 6:06, after you wrote IPointerExitHandler there is a lot of new code. =/

  • @madmax-ut8ht
    @madmax-ut8ht 3 ปีที่แล้ว +5

    What are you doing to be able to implement at 6:06 ? I am using Visual Studio Code and it looked so easy when you did it, but I don't get the option

    • @nintexonfire
      @nintexonfire 3 ปีที่แล้ว

      yeah thats also my problem

    • @b3dsign
      @b3dsign 2 ปีที่แล้ว

      Same here...

    • @dankenarigato
      @dankenarigato 2 ปีที่แล้ว

      Yo~ my solution is using visual studio 2019 to open the script and hover on the error -> click "impletment interface" on each of them. hope it helps ~

  • @tuanoful
    @tuanoful 5 ปีที่แล้ว +2

    This was great, thanks!

  • @jasoneider7589
    @jasoneider7589 ปีที่แล้ว +1

    Hey! Would you still recommend creating your own scripts over using Unity's built-in toggle system in it's current state (2022+)? I'm wondering if they have improved it enough that you would recommend it.

  • @eldanridley7
    @eldanridley7 4 ปีที่แล้ว

    really helpful video, thank you!

  • @Kokomo78
    @Kokomo78 4 ปีที่แล้ว

    Wow. Thank you for your clip. I thought I know well enough about Unity. But after watching your clip, I realized I know nothing about Unity.

  • @danielbird2182
    @danielbird2182 4 ปีที่แล้ว

    Super helpful! Would be great to get anyone's advice on the best way to deselect a Tab and Page on the second click (a click on the same tab as the first click).

  • @liamvisionary9608
    @liamvisionary9608 ปีที่แล้ว

    Love these videos, but just wish that proper naming conventions were used. I'm having trouble figuring out if something should remain public or be set as a private member

  • @Cefaun666
    @Cefaun666 4 ปีที่แล้ว +1

    Thanks for all you great work! I've learned tricks from your vids that save me hours of effort in the long run (particularly adding functions to the right mouse click menu). However, I was wondering if you could point me in the right direction to make this tab system more controller/keyboard friendly? I've tried a few things with the event system, but can't seem to make the submit button show each tab.

  • @myriadtechrepair1191
    @myriadtechrepair1191 3 ปีที่แล้ว +1

    I just wanted to point out that in line 27 at 8:45 you check either for selectedTab==null and button!=selectedTab. The ==null case is redundant, isn't it? If the first case is true, then that means the second case must also be true.

  • @rekss9252
    @rekss9252 3 ปีที่แล้ว

    Thanks man this is so amazing

  • @sevovideo
    @sevovideo 4 ปีที่แล้ว +1

    Hey, great tutorial. Can you tell me, what should I do somewhere at 12:27, when I want to invoke onTabDeselected, when I click on selected tab again?

  • @namoviot
    @namoviot 3 ปีที่แล้ว

    thanks for this super helpful tutorial

  • @luciojcp
    @luciojcp 2 ปีที่แล้ว

    Excellent video. Nice work! Subscribed!!!
    I have 1 question... And when you have so many tabs in your screen (mobile for example, 5-6 tabs are wider the screen width), how to make a horizontal scroll for the tabs, keeping the content at the same place, changing when clicking on the tabs? Can you make another video? Thx

  • @casualbachgiagame4552
    @casualbachgiagame4552 4 ปีที่แล้ว

    Great tutorial! It help me alot.

  • @joaovictorlapollimota2652
    @joaovictorlapollimota2652 3 ปีที่แล้ว +1

    Great tutorial! I'm a new viewer here and I'm really loving all the videos....
    Personally, I would like to suggest a change in the Logic there. Perhaps doing something a bit more advanced:
    1 - create a tabButtonBase script (on which all tabButtons inheritance from)
    2 - Use prefabs/Nested prefabs for your TabButtons
    3 - (this is probably the biggest change) instead of executing the logic of activating/deactivating the windows on the TabGroup script let the TabButtons script handle what they should do where ever they are activated/deactivated. In my opinion, the TabGroup should only be responsible for handling which tabs are/are not active and don't not executing any inner logic on the tabs.

  • @nickmalialis6
    @nickmalialis6 4 ปีที่แล้ว +2

    Hello. Great tutorial. One question, how do select / define which tab is selected on start up. Tab in index 0, is not what auto selects, it is usually 3 or 4.

    • @GeeCeeAte
      @GeeCeeAte 4 ปีที่แล้ว

      same problem here. You ever fix it?

    • @stergiosk6424
      @stergiosk6424 3 ปีที่แล้ว +2

      Late reply, but if anyone still wondering, I found a solution. On TabButton script, use a public bool variable and set it to false and add on Start method:
      if (variable){ tabGroup.OnTabSelected(this)}. Then on unity, for the tab you want to be selected on start up, just set the bool variable to true (by checking the box). Hope it helps!

  • @lavizpandey9957
    @lavizpandey9957 2 ปีที่แล้ว +1

    Good one,Thanks

  • @dmitriysparrow
    @dmitriysparrow 5 ปีที่แล้ว

    sumptuously! Thank you

  • @WBT-p9b
    @WBT-p9b 4 ปีที่แล้ว +1

    0:55 scared me there mate xD

  • @muratkk1096
    @muratkk1096 ปีที่แล้ว

    great tutorial, thanks a lot

  • @aneetnadella1123
    @aneetnadella1123 3 ปีที่แล้ว

    Awesome tutorial!

  • @BenjaminK123
    @BenjaminK123 4 ปีที่แล้ว

    This is a great video nice and easy code thank you

  • @BleachWizz
    @BleachWizz 4 ปีที่แล้ว +2

    Amazing video, this helps a lot for a quick project and understanding. But I still see a lot of bad practices that wouldn't scale well... Fact is I'm also one who has a lot of trouble with it.
    Would you be interested in making a video showing how could you get these 2 tabs you made into abstract classes and inherit it to recreate what you just did, plis how you can have 2 kinds of tab systems on the same project using theses classes?
    This is something that's rarelly shown and I'm sure I'm not the only one who struggles with it. C=

  • @sampleee
    @sampleee 4 ปีที่แล้ว +2

    You should have made it use a dictionary instead of just getting the index, that just makes it a lot more user friendly and readable

  • @EddiePenta
    @EddiePenta 4 ปีที่แล้ว

    This is a great video! Any reason why you loop through objectsToSwap instead of just deactivating the previous selectedTab and activating the newly selected tab?

  • @besportscrazy
    @besportscrazy 4 ปีที่แล้ว +5

    Good info, but thumbnail is really misleading

  • @MrValiantrobe
    @MrValiantrobe 3 ปีที่แล้ว +1

    When I try to do this I end up with my icon being replaced by my tab_hover or tab_idle sprites, and obviously I want to reproduce what you've done here with having the icons over the background, but I'm wondering how you accomplish that. Are the sprites of the icons simply hanging over where the tabs are?

    • @MrValiantrobe
      @MrValiantrobe 3 ปีที่แล้ว +1

      Hah, nevermind, for some reason yesterday I thought I should try to put the icon i want into the same place that the other sprites go, but instead realized I should just attach an empty gameobject to each tab gameobject and add the sprite to that.

  • @enolya
    @enolya 4 ปีที่แล้ว

    Referencing! Keep it up :D

  • @JaiWithani
    @JaiWithani 2 ปีที่แล้ว

    If you made the pages a property of the tab buttons instead, couldn't you disable/enable them without keeping track of an index?

  • @adnansiddiquegd7186
    @adnansiddiquegd7186 4 ปีที่แล้ว

    thanks it is really helpful

  • @cesarsampedro_dev
    @cesarsampedro_dev ปีที่แล้ว

    So cool!, Where I can get those tab icons for the editor?

  • @jiaqili1644
    @jiaqili1644 4 ปีที่แล้ว

    That's perfect for my app Thanks for exist :3

  • @jtherussian
    @jtherussian 2 ปีที่แล้ว

    What if I wanted to have all pages enabled instead of disabled in the Scene? How do I make the Page 1,2,3,4,5 all stay enabled when starting the game?

  • @TheErusPrime
    @TheErusPrime 2 ปีที่แล้ว +1

    Okay I finally got back to my computer and realized I have no idea how to set this up. Unity using the same icon for every kind of element is really annoying. Are they all just images? Tryna learn how to make things and I am absolutely lost at the first step

  • @ast_rsk
    @ast_rsk 4 ปีที่แล้ว +2

    I like how you don't waste memory with an empty list until you actually need it. Great detail.

  • @Espiritoheroico
    @Espiritoheroico 3 ปีที่แล้ว

    THIS IS AMAZING

  • @WalterMan
    @WalterMan 3 ปีที่แล้ว

    Great video! But how do I make it so Tab One is selected by default? Thanks

  • @danipuig8830
    @danipuig8830 3 ปีที่แล้ว

    how can select one of this tabs when Start() function runs? Thanks, good video man!

  • @breme248
    @breme248 3 ปีที่แล้ว

    You gained a sub

  • @binarium4376
    @binarium4376 3 ปีที่แล้ว

    I am getting a null reference Exception after I added the tabIdle, TabHover, tabActive. it is showing that there is a problem on the tabgroup script

  • @Distortion3933
    @Distortion3933 4 ปีที่แล้ว

    Awesome video, but now I want to know what the song is that's playing in the background

  • @HAWXLEADER
    @HAWXLEADER 3 ปีที่แล้ว +8

    10:04 why not simply do "objectsToSwap[i].SetActive(i==index)"?
    it's much cleaner.

    • @gush5436
      @gush5436 2 ปีที่แล้ว

      Thanks!

    • @diegoschram
      @diegoschram 2 ปีที่แล้ว +1

      You also need to think that maybe newer people to coding will use this, its easier to understand a if statement, imo. People with more knowledge will adapt the code to own needs or preferences just like you ;)

  • @joshuarobinson7422
    @joshuarobinson7422 4 ปีที่แล้ว

    You could also use Enums

  • @vishnu2737
    @vishnu2737 3 ปีที่แล้ว

    Not showing initial selection, when Start the game, button tab not highlighted?

  • @vikchristy1238
    @vikchristy1238 4 ปีที่แล้ว

    Hi,
    In visual studio the public List is not being refered or unrecognizable. I was hoping if you could help!

    • @adamantal9129
      @adamantal9129 4 ปีที่แล้ว

      You create list in c# like public List nameOfList = new List();

  • @thecookies6109
    @thecookies6109 2 ปีที่แล้ว

    How do you ensure all colors return to their previous colors when idle? rather than a specific color? , Also How do you ensure 1 is activated at Start?. Finally How can I check parent name from child so I can then assign numbers to each tab or ID????

  • @rhapen
    @rhapen 4 ปีที่แล้ว

    if you want to use background.color like me, do not forget to set the alpha channel of the public colors in inspector ..like me :) . public colors from script are created with alpha 0

    • @DonCDXX
      @DonCDXX ปีที่แล้ว

      Thank you, I was having this exact problem.

  • @ai.one.prompt
    @ai.one.prompt 2 ปีที่แล้ว

    thx for ideas for game.

  • @erikponti1753
    @erikponti1753 2 ปีที่แล้ว

    LOVE IT!

  • @HojpMania
    @HojpMania ปีที่แล้ว

    Activating page with index doesnt seem to work at all for me, just stays at 0

  • @ROCKSMASHER
    @ROCKSMASHER 3 หลายเดือนก่อน

    Nice man