How to: Dynamic Scroll View in Unity

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

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

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

    Scrolling is great, but don't scroll past the subscribe button and forget to press it ❤️
    Wishlist my new game BUMBI on Steam! store.steampowered.com/app/2862470/BUMBI/

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

      nice video! +1 sub

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

    Ive been working with unity for 8+ years now and I keep forgetting how to do this (as I maybe do it once every 3 years...) so I have to keep looking it up.
    This was short and to the point. Great video. Subscribed. Thank you.

  • @GabrielGcbs
    @GabrielGcbs ปีที่แล้ว +6

    For anyone having the same issue as me: padding, spacing and all dinamic settings weren't working no my prefab.
    I realized that the problem is that my prefab was an empty gameObject with another gameObjects as childs, and the image source for them was on spriteRenderer, but in order to work on scrollView, the objects must be Canvas Images, so go to UI->Image to create your image prefabs.

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

      Thank you so much for this comment, I was having issues with the layout groups not working and thanks to your comment I realised to switch my sprite renderers into the image ones.

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

    Finally Samyam to the rescue, I cannot believe how small things like pivots fall out of my mind.

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

    4:22 Today i spent 2 hour to create my self auto-sizer script, this is incredible and so funny that Unity have a component for this 😅😂😂 Today's lesson: You need to watch tutorial before you make something.

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

    Super clean and straight to the point. I'll be referencing this video a LOT in the future!

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

    This is an amazing tutorial. I didn't even know Unity had these features. It's so very easy.

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

    Can you show us how to add scroll view when we have large number of objects? Like dynamically display only few on screen

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

    Very clean, understandable and straight to the point. Love it, keep it up.

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

    Wow. This video covered a lot of gaps in my knowledge. Subbed for sure.

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

    Thank you Samyam, I was actually thinking about doing something with scrolling recently.

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

    Another great video, Sam! I keep forgetting about those IPointerXxx interfaces, thanks for the reminder!

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

    this is eerily close to what i was looking for. good tempo, too!

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

      Thank you so much for the donation! ❤️

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

    Just what I needed for my internship project!!! Thankss

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

    actually you could serialize and instantiante items not as gameObject but as ScrolViewItem, in this case you don't need to tryGetcomponent method and acces to properties and methods directly.

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

    thank you, the Layout Groups solved my issue I was trying to solve!

  • @uhrcru
    @uhrcru 2 หลายเดือนก่อน

    SO COOL, It helped me a lot but would be cooler if you would explain how to add more items like 2x2 instead to 1x10

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

    Thanks for the great tutorial, with this and your other video about creating a leaderboard it helped me understand how to create a dynamically loading leaderboard!
    These have been super helpful and I know I can use your content as resources in the future

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

      Glad to hear! 😄

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

    It's a bit more complicated, but could you please teach how to make a book interface with page turning animation? Something like some games do (Skyrim I remember does)

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

    Praise you, oh, wise keeper of unity secrets and all things unknown! A lamb shall be offered in your name.

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

    Nice. That's exactly what I was looking for🥳

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

    Thank you! this is what i'm looking for 😁

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

    Such incredible timing, can you read my mind? 😍

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

    you're a great teacher

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

      Thank you!

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

    Thanks a lot for this tutorial. ❤️👍👏

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

    This is exactly what i need thank you 👍

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

    This is really helpful. Thanks a lot!!!

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

    Is it possible to divide the horizontal scroll into 4 pages & then make the scroll to snap to each page?

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

    I tried making this with a vertical layout group instead, but all of the child items were just centered in the middle.

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

    I have always done the content size calculations in code u.u ContentSizeFitter would have saved me soooo much math @.@
    I also always put a button in the prefab for click events! I think the interface is generally better.
    Despite building many dynamic scroll views I still have more to learn /o/ thanks for the tid bits!
    Now one thing I couldn't solve was an infinite scrolling scroll view.... where the items loop back around. Conceptually I understand it, but mathematically it wasn't working right. I'm still alive so I will figure it out XD

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

    That was so cool.

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

    Can you Make a Short Video on How to adjust Cinemachine Cam Sensitivity through Slider pls...

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

    Please make a tutorial for tab menu system. Like in shop menu of many casual games.

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

    Hi💜Can you make a tutorial for opening portal from one scene to another scene.

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

    Buen vídeo como siempre 😃

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

      Gracias!

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

    good one !

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

    I'm having a weird bug. When I copy and paste or drag my prefab into the Content panel, everything works fine. But when I instantiate through code exactly how you did, all of the items get squished and get negative sizes. Anyone have any ideas? I've had the worst luck with the [Horizontal/Vertical]Layout groups cause of things like this. EDIT: In code, I force the .sizeDelta to what I know it should be and it looks great. So weird!

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

      Are you using the Start event/method? As far as I know the layout groups don't react to having items added to them so you have to trigger them to do a layout if you have already passed the layout phase.

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

    This definitely scrolling but what do you mean by dinamic?
    The only reason don't use scrolling very offended in unity is because the is don't work correctly wean you use arrow keys and dpad what I mean by that is let say that I have i list with items in the dinamic scrolling wail that player able to select with keyboard or controller the right item wean the go to the go out off the view area for some reason the don't move the don't scrolling the scroll bar

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

      Adding in an infinite amount of items through code, and having the UI automatically fit any number of items.

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

      @@samyam do you know how to make the scrolling area to move wean the wean someone use keys and move in the object on scroll that is out of view area?
      If you don't know don't wory I will ask in the discord company

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

    👍

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

    Thanks! I wasn’t aware of TryGetComponent() previously, it’s a great fail safe method. I added an else in there to Debug.LogError() when the component wasn’t found.