Scroll View in Unity - 2021 Tutorial

  Рет қаралды 105,250

Tarodev

Tarodev

Күн бұрын

If you've ever needed a scrollable container of items in your Unity game menus, keep watching! Confine any number of items to the limits of a container and mask the overflow.
Learn about the different settings of the scroll view/rect as well as how to use the 'Content Size Fitter' to dynamically resize your content.
❤️ Become a Tarobro on Patreon: / tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: / discord
✅ MORE TUTORIALS: / tarodev
About Tarodev:
Develop video games like a pro!
Whether you're a beginner or a seasoned game developer, you'll find lots of useful tips and tricks to boost your development career. Visit the channel: / @tarodev

Пікірлер: 119
@barsz3
@barsz3 Жыл бұрын
Great! No intros, no begging for likes, just straight to the point. Exactly what I was looking for. Thank you.
@KingJames586
@KingJames586 Жыл бұрын
I've watched a half dozen videos and your is, by far, the best explained (and up-to-date, compared to Brackey's!) Thank you!
@jpalz1
@jpalz1 2 жыл бұрын
I had been struggling with this for quite a bit, and your tutorial helped me immensely. Thanks a bunch! :D
@alperencan4939
@alperencan4939 Жыл бұрын
For the ones who are new in Unity, if you want to group these 9 objects under "component", select all objects then press ctrl+shift+G
@JianqiuChen
@JianqiuChen 2 жыл бұрын
super cool stuff to learn on the weekend lol, will watch the entire playlist.
@michelmilek2891
@michelmilek2891 2 жыл бұрын
Great tutorial, directly to the point. Thank you very much!
@armin1888
@armin1888 3 ай бұрын
Thanks! This tutorial was great, got me right back into the components I forgot how to use. One thing to add the Content size fitter shouldn't be on the same object as the layout group according to Unity. I fixed it by adding it to the parent (Object with Scroll Rect component)
@user-qh5fv7wc8l
@user-qh5fv7wc8l 2 жыл бұрын
I just started to watch your tutorials. It's pretty helpful. Thanks. 괜찮은 튜토리얼 같아요~~ 땡큐~ ㅎㅎㅎㅎㅎ
@kameliajamaati9662
@kameliajamaati9662 Жыл бұрын
Very concise, clear and helpful. Thank you so much
@Xarma007
@Xarma007 2 жыл бұрын
This some top notch tutorial, nice and short, thank you!
@Community-Compute
@Community-Compute Жыл бұрын
Thanks, super helpful! Came here to brush up on this component before implementing a new quest journal UI. I'm ready now.
@_sIash
@_sIash Ай бұрын
I always end up finding the solution to almost anything on this channel, bravo taro 👍
@affenkratzer
@affenkratzer Жыл бұрын
this makes my shop look much better thank you
@EdadImperial
@EdadImperial 2 жыл бұрын
Ty for the tutorial, you explain my problem with the content size and give a direct answer (ContentSizeFitter) and why, ty
@jasondotjson34
@jasondotjson34 2 жыл бұрын
Thank you for the tutorial I just needed that!! :)
@Hideyuki_Atago
@Hideyuki_Atago Жыл бұрын
I wanted to make a questing system, and since I'm having a lot of quests eventually I would need a vertical one, thought I would have to code it out then I noticed scrollview and that brought me here haha, very easy to follow
@svyat1003
@svyat1003 Жыл бұрын
Maaan, u saved my graduate work. I make an educational game and could not figure out how to create a table to display data from a database. ChatGPT gave me half working code without explaining how does it work. But your video showed me step by step how to do it on simple example.
@djpierreb
@djpierreb 2 жыл бұрын
You saved my life for the second time ! Great job
@ScarletSnake
@ScarletSnake Жыл бұрын
Instant sub, this is great! Thank you! 👏👏👏
@alvarofrederico3719
@alvarofrederico3719 2 жыл бұрын
you just had the right answer all the time, thank you S2
@blackwhalestudio
@blackwhalestudio 3 ай бұрын
Excellent tutorial, thanks a lot!
@AlexGorskov
@AlexGorskov 2 жыл бұрын
Great tutorial, thank you, Tarodev!
@Tarodev
@Tarodev 2 жыл бұрын
:D
@bissash103
@bissash103 Жыл бұрын
This was a really helpful tutorial!
@bunggo9914
@bunggo9914 2 жыл бұрын
disable show mask graphics in the mask component, it will hide the mask image so you will never need to reduce the alpha to 1.
@Tarodev
@Tarodev 2 жыл бұрын
Oh wow... Thank you
@graig2558
@graig2558 Жыл бұрын
Perfect video as always. One thing I would love to see is how to scroll using gamepad/keyboard etc?
@aussie_bay_flpz4166
@aussie_bay_flpz4166 2 жыл бұрын
Great tutorial ! You have a new sub
@ioannapanali7576
@ioannapanali7576 2 жыл бұрын
Thank you for this tutorial!
@alperdogru1745
@alperdogru1745 2 жыл бұрын
You are great. Thank you for tutorial !
@phineasfacingforward3460
@phineasfacingforward3460 2 жыл бұрын
The best tutorial on ScrollRects ive seen
@Tarodev
@Tarodev 2 жыл бұрын
This was my VERY first tutorial 😊
@galigapiya
@galigapiya Жыл бұрын
Perrrrfect tutorial. Thanks!
@pixitales5017
@pixitales5017 2 жыл бұрын
Nice tutorial! You missed one thing. You know how your scroll view always show at the center of the viewport? You can change that by moving the pivot point all the way on left. Then your view port starts on the left side.
@proximacentauri9509
@proximacentauri9509 2 жыл бұрын
Mate i tried your method but it doesn't work to show the images in the center of the view port, do you have a tutorial for that please ?
@klajdimyftari4691
@klajdimyftari4691 2 жыл бұрын
@@proximacentauri9509 if you are using windows keep the alt key while you select left side on RectTransform panel. If you are using a Mac keep the Cmd key pressed instead
@proximacentauri9509
@proximacentauri9509 2 жыл бұрын
@@klajdimyftari4691 Thank's mate!
@therandom446
@therandom446 2 жыл бұрын
Holy shit you are a god thank you
@callergaming2575
@callergaming2575 Жыл бұрын
Thanks alot
@ExoticElephantStudios
@ExoticElephantStudios 2 жыл бұрын
Thanks Tarodev, very cool
@luanleme5684
@luanleme5684 2 жыл бұрын
Thanks for the help!
@mani_mincraft
@mani_mincraft Жыл бұрын
thanks for the great tutorial!
@Aryazaky
@Aryazaky Жыл бұрын
If you can't scroll anything even tho you have an event system, make sure that your contents doesn't have an EventTrigger component. Because for some unknown reason it will catch the pointer events and prevent the parent which has ScrollRect (Who needs pointer events) from catching the events. As a workaround, implement the IPointer interfaces directly instead of through an EventTrigger
@hdggfhjb6768
@hdggfhjb6768 2 жыл бұрын
Great. This is best tutorial for scroll in untiy.
@user-kb3tp9gx2g
@user-kb3tp9gx2g Жыл бұрын
Thank you so much. You sooooo good!!!
@luiginicastro1101
@luiginicastro1101 2 жыл бұрын
Would you be able to create a carousel effect for the UI so it's constantly looping when you scroll?
@tomas.menniti
@tomas.menniti 8 ай бұрын
thanks a lot for sharing, you are amazing!
@w_ldan
@w_ldan 5 ай бұрын
Absolutely come in clutch thanx😂
@pransukatiyar9536
@pransukatiyar9536 Жыл бұрын
Thanks for this tutorial
@IlanPerez
@IlanPerez 2 ай бұрын
Thanks very helpful
@cwdgamedev1017
@cwdgamedev1017 10 ай бұрын
Thank you!
@deivid-01
@deivid-01 2 жыл бұрын
Thanks a lot !
@arjunmehta2853
@arjunmehta2853 Ай бұрын
Hey! In the part where you were talking about masking, when you add the Mask component, there is an option to untick "Show Mask Graphic" in order to remove the white part, which is the better method to use. Hope this helps!
@dridrimoon6275
@dridrimoon6275 5 ай бұрын
thanks a lot !
@BenjaminWidawski-vi1hl
@BenjaminWidawski-vi1hl Жыл бұрын
Thanks!
@kim1234kim
@kim1234kim Жыл бұрын
hi, great video!! How would you get the list to start over at the end? After the sword, the smiley face is there again without having to scroll in the opposite way
@mariusst09
@mariusst09 Жыл бұрын
Thenks bro ❤
@nwotyzarc
@nwotyzarc Жыл бұрын
I always come back here when I set up a scroll rect :D
@Tarodev
@Tarodev Жыл бұрын
Sometimes the brain just cannot retain certain information 😂
@duyha2454
@duyha2454 10 ай бұрын
thank you
@unitynocode
@unitynocode Жыл бұрын
Thank you so much ! No code is always cool 😊
@klausbdl
@klausbdl Жыл бұрын
if you cant move your list, dont forget to add the Event System... I forgot about that and I was banging my head for ages trying to figure out the problem
@funlightfactory6031
@funlightfactory6031 Жыл бұрын
OMG!! Thank YOU!!! I was having the exact problem!!
@makingtechfriendly
@makingtechfriendly Жыл бұрын
Thanks
@Vulcagon
@Vulcagon 11 ай бұрын
at 2:27 the easyest way to make the viewport transparent is to just untick "Show Mask Graphic" in the "Mask" window
@arunross
@arunross 8 ай бұрын
Thank You...
@charithnirmal5823
@charithnirmal5823 Жыл бұрын
Brilliant
@user-hl7ti6yy3x
@user-hl7ti6yy3x 2 жыл бұрын
ty
@eliorubenmc
@eliorubenmc 2 жыл бұрын
every time I see this channel I say in my head: "En Taro Adun" and think the icon isn't right ha ha ha, but not everybody is an StarCraft fan... anyway, Good video, thanks!
@rafaelbrustolin4687
@rafaelbrustolin4687 9 ай бұрын
thanks love u
@user-od9gx8xd2j
@user-od9gx8xd2j Жыл бұрын
thank you good
@kyleme9697
@kyleme9697 2 жыл бұрын
Be my first subscriber ... Are you saying at the end this was your first video? Its just over 14 months later and you've got over 28K subscribers now. Good job !! I personally love the short n sweet videos so I'm going thru all of yours now. Thanks !!
@Tarodev
@Tarodev 2 жыл бұрын
Yessss, I had zero subs at this stage and was excitedly waiting for my first 😊 Thanks for enjoying my content!
@Mushe94
@Mushe94 2 жыл бұрын
Show mask graphic on the Mask component avoids having to change the alpha
@MyRapper34
@MyRapper34 2 жыл бұрын
Thank you!
@AkashKumar-gu7jc
@AkashKumar-gu7jc 2 жыл бұрын
Hey, Take This!⭐ Great Tutorial!
@Tarodev
@Tarodev 2 жыл бұрын
Ohhh, a gold star 😊
@AkashKumar-gu7jc
@AkashKumar-gu7jc 2 жыл бұрын
​@@Tarodev Yes... I made it the same quality as your videos 😃 I have one request, if you will, Do you know how to build a Popup which closes on outside click. I'm struggling with it! I tried using OnDeselect, OnPointerEnter, OnPointerExit. And inside OnEnable() { EventSystem.current.SetSelectedGameObject(gameObject); } But, that solution doesn't work for nested Panels. (eg Button on Panel --> (opens another) ---> Button on Panel Can you please recommend a solution/resources for that? Also, my understanding of IPointerClickHandler IPointerDownHandler IPointerEnterHandler IPointerExitHandler IPointerUpHandler is very meagre. If possible please recommend some resources. Looking for your kind help...
@shanjohnkj6851
@shanjohnkj6851 2 жыл бұрын
Life Saver
@user-zb4ri7wk7g
@user-zb4ri7wk7g 2 жыл бұрын
Can i figure out somehow is object in scroll viewport (visible) or not? I found a Unity component "ScrollView" that has a "visible" property but I can't figure out how to access "ScrollView", only I can find is a "ScrollRect"
@NairatAhmad
@NairatAhmad Жыл бұрын
Is there a way to scroll a step-by-step? like .. I created something by putting arrows to the left and right, and scrolling my panel by Image width on click, this way it jumps one picture/image on a time. Is there an easy/simple way to do it with the default scrollbar the way you've shown us? Great video BTW :)
@apemant
@apemant Жыл бұрын
Perfect, thank you! Typical Unity thing that's unintuitive. Anyway, I put the Mask on a direct parent of the "Scroll" object which also worked out fine, so there was no need for the "View" object for my purposes.
@Hamentsios10
@Hamentsios10 Жыл бұрын
amazign tut
@karbashevsky
@karbashevsky 11 ай бұрын
I came looking for copper and I found gold. Thank you so much!!! Also is that possible to use mouse scroll for scrolling but not mouse drag?
@TrentTheTraveler
@TrentTheTraveler Жыл бұрын
Does anyone know how to clamp scroll to each object within the "scroll view"? So in your case, It would stop at each character and in order to go to the next character, you would have to scroll again. Sort of like swiping through images on your phone?
@turquoise7817
@turquoise7817 Күн бұрын
i would recommend using the "simple scroll snap" asset (free). i'm currently trying to use it and i am running into issues (mostly to do with my own usage) but it overall seems really helpful
@heavensfield494
@heavensfield494 Жыл бұрын
If the content size fitter just makes the content holder width turn to 0, Is it because you have use an empty gameobject as the content, just fix them by making the size of the empty gameobject bigger
@radamantiun1994
@radamantiun1994 Жыл бұрын
How can i achive this result, without UI items
@iprg8406
@iprg8406 Жыл бұрын
when i do this all of the objects snap back to position after i move them
@molcho9286
@molcho9286 10 ай бұрын
I have a problem, my scroll rect onty scrolls if I touch outside my buttons, and if I try to scroll putting my finger on a button it selects it, how can I fix it?
@nmhero4824
@nmhero4824 2 жыл бұрын
This wont work for me for some reason, I have followed multiple tutorials and even used the built in object but nothing will scroll
@abdullahshafqat772
@abdullahshafqat772 Жыл бұрын
Hey great tutorial as usual. Could you help out with one thing though I followed along your 3D objects in UI tutorial and then wished to create a scrollable view with those but doing this does not seem to mask the 3D objects
@Tarodev
@Tarodev Жыл бұрын
Indeed, it won't work with 3d as scroll view is a canvas specific utility. You'd need to either use a camera with bounds limited to the scroll area, or a Shader which cuts it off
@mendoncagamer6021
@mendoncagamer6021 6 ай бұрын
Hello, I'm from Brazil and I'm using Google translate to communicate, can you clear up my doubts? I would like to do it using the horizontal scroll bar, but I don't know how to make it active, because every time I play the scene the horizontal bar turns off, I've tried several options but it keeps turning off by itself when I play, do you know what it could be?
@MagnusRazer
@MagnusRazer 9 ай бұрын
Bastante util
@AnandMishere
@AnandMishere 5 ай бұрын
Particles are not visible inside the scroll view, even the visible inside mask is enabled in renderer
@reydion1648
@reydion1648 2 жыл бұрын
Excellent tutorial! I only have one issue. When I add the "Content Size Fitter" component onto Contents, I lose the ability to scroll. It's like the size Content becomes 0 and I can't scroll past the centre of the the screen.
@IcieJuicy
@IcieJuicy 2 жыл бұрын
I ran into this same issue and noticed that he had a horizontal layout component added to the content container. I added it and that resolved my issue. Hope it helps :)
@Duros360
@Duros360 2 жыл бұрын
@@IcieJuicy Im having this same issue, Which object has the "horizontal layout component"? The Panel, the View or the Contents?
@murielbullot5632
@murielbullot5632 Жыл бұрын
@@Duros360 the Content
@alenogales4073
@alenogales4073 Ай бұрын
@@IcieJuicy thank you so much for this comment, you just saved me, lol
@adhocdropoffs
@adhocdropoffs 2 жыл бұрын
I know it's been almost a year but if you're still around: When I follow these steps, I can't see the items on the far left unless I pull them into view with elasticity and then they bounce back out of view. So my steps are to make a new scroll view with the default scrollbars etc. Increase the height of the scroll view > Make the content a vertical layout group > Make 7 child objects with layout element components (I also added a child image to each of these so I can see them) > Set their Rect transform height to 100 > Play. Items at the top of the list dont stay visible.
@adhocdropoffs
@adhocdropoffs 2 жыл бұрын
Figured this out but for anyone hitting the same issue: I had to make sure that my Content's height was much bigger, and went outside the viewport and then the vertical layout group on my Content had padding on the top and bottom (200, -200) that kept things in the right place
@Tarodev
@Tarodev 2 жыл бұрын
@@adhocdropoffs You could also check out "content size fitter" to dynamically resize it to fit the content.
@StrawberryDeveloper
@StrawberryDeveloper 6 ай бұрын
Lets say i only have one item, how can i make it stick to the left or right, instead of the center(Building a dynamic inventory system)
@Tarodev
@Tarodev 6 ай бұрын
You could create a wrapper object around your item. The wrapper can be full width and the item can be left aligned within
@user-kk7hw6qr2c
@user-kk7hw6qr2c 9 ай бұрын
I'm lost right at the start as the item "Content" I have no idea what that is...a empty gameobject? a panel? You refer to it as a container, but I don't know what that is.
@nocelebrity6042
@nocelebrity6042 Жыл бұрын
The "mask" effect of this does not happen for me when I follow this to the letter. When Unity's default ScrollView is added using the GameObject menu, that maps most of the arrangement discussed in the tutorial, and yet, when settings are adjusted to match what this tutorial says to the letter, the "mask" effect still does not happen. Another thing that never happens no matter how much content is added is the scroll **stopping where the user lets go of it** after the user releases the mouse button. Instead, the scroll view's content bounces right back to wherever it started.
@Tarodev
@Tarodev Жыл бұрын
Look into the content size fitter. What's happening is the content is bigger than the actual content rect, so it flings back to where it actually fits into the scroll, even if the content is overflowing
@_mirai
@_mirai 8 ай бұрын
goood
@kotraner
@kotraner 2 жыл бұрын
Hello ! :) I joined your Patreon :) and I become Tarobro! but it doesn't have image that this tutorial show~ , any way that I can get it to follow your tutorial?
@Tarodev
@Tarodev 2 жыл бұрын
This video was looooong before my patreon, but message me on patreon and we can work something out!
@kotraner
@kotraner 2 жыл бұрын
@@Tarodev Ok I just sent you message on Patreon :)
@Hakkology
@Hakkology 3 ай бұрын
Scrollview actually took my 2 days and i still haven't figured out the solution. Elastic component automatically returns to original position after dragging. Such a nasty component...
@TylerLarson
@TylerLarson 2 жыл бұрын
Very first subscriber..... Hmm.
@paellarusa
@paellarusa Жыл бұрын
Im surprised by how nobody asked about how you copy+pasted the images and they stuck one after other? 4:49 Doesn't work for me. Okay I found it. By Layout Group. Thanks
@yahsaikol6279
@yahsaikol6279 9 ай бұрын
hmmm, it's not working g:(
@Liqvidniy
@Liqvidniy 2 жыл бұрын
Thank you!
@dfilitto
@dfilitto 2 ай бұрын
Thanks!!!!!
Drag and Drop in Unity - 2021 Tutorial
6:10
Tarodev
Рет қаралды 43 М.
10 Things You NEED to Be Doing in Unity
11:40
Tarodev
Рет қаралды 129 М.
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 44 МЛН
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 135 МЛН
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 18 МЛН
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,6 МЛН
How to make a menu in Unity - UI Tutorial
26:27
Tarodev
Рет қаралды 182 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4 МЛН
Scrolling and scrollbars in Unity - Unity UI tutorial
5:42
Coco Code
Рет қаралды 106 М.
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 749 М.
Scroll View. Пошаговое создание. Unity3D
12:03
Unity Developer
Рет қаралды 10 М.
How to: Dynamic Scroll View in Unity
12:42
samyam
Рет қаралды 34 М.
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,4 МЛН
How To Get A Better Grid Layout in Unity
12:04
Game Dev Guide
Рет қаралды 205 М.
Coding Adventure: Portals
16:06
Sebastian Lague
Рет қаралды 1,3 МЛН
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 44 МЛН