samyam | How to: Dynamic Scroll View in Unity @samyam | Uploaded July 2022 | Updated October 2024, 1 hour ago.
Learn how to make a dynamically sized scroll view UI in Unity Canvas easily.
แ Get the full Source Code Bundle to my Unity Tutorials ๐ค
sam-yam.itch.io/samyam-full-source-code-to-all-videos
๐ฅ Get the FULL Source Code ๐ฅ
patreon.com/posts/69275327
Wishlist my new game BUMBI on Steam!
store.steampowered.com/app/2862470/BUMBI
๐ค Support Me ๐ค
Patreon: patreon.com/samyg
Donate: ko-fi.com/samyam
First we need to add a scroll view to our scene, then under the Content gameobject you can add your item prefabs that will be in your scrollview. To make it dynamically resize the content of the Rect Transform based on the number of items, you either add a Horizontal Layout Group or a Vertical Layout Group to the Content Gameobject along with a Content Fitter component set to Preferred setting. Then to dynamically load objects in through code you can get a reference to your prefab, the list of items or images you want to spawn, loop over them and spawn them under the Content transform, and do other processing.
โบ๐ Relevant Video Links ๐
โบKenney UI Pack: Space Expansion
https://www.kenney.nl/assets/ui-pack-space-expansion
โบKenney Pixel Shmup
https://www.kenney.nl/assets/pixel-shmup
โบโฑ๏ธ Timestamps โฑ๏ธ
0:00 Intro
0:05 Set up ScrollView
1:42 Horizontal Layout Group
3:53 Content Fitter
5:48 Dynamically Add Items Through Code
10:31 IPointerClickHandler
11:19 Outro
๐๐THANK YOU TO ALL MY PATRONS ๐๐
โฏโฏโฏ My Links โฎโฎโฎ
๐ Patreon ๐
patreon.com/samyg
๐ฌ Discord Server ๐ฌ
discord.gg/SwCKB3Q
๐ฆ Twitter ๐ฆ
twitter.com/samyam_utube
๐ Facebook ๐
facebook.com/samyam.youtube
๐ Like and Subscribe! ๐
๐ฅ๏ธ Computer Setup ๐ฅ๏ธ
*As an Amazon Associate I earn from qualifying purchases.
amazon.com/shop/samyam
#unity3d #unitytutorial #gamedevelopment
Learn how to make a dynamically sized scroll view UI in Unity Canvas easily.
แ Get the full Source Code Bundle to my Unity Tutorials ๐ค
sam-yam.itch.io/samyam-full-source-code-to-all-videos
๐ฅ Get the FULL Source Code ๐ฅ
patreon.com/posts/69275327
Wishlist my new game BUMBI on Steam!
store.steampowered.com/app/2862470/BUMBI
๐ค Support Me ๐ค
Patreon: patreon.com/samyg
Donate: ko-fi.com/samyam
First we need to add a scroll view to our scene, then under the Content gameobject you can add your item prefabs that will be in your scrollview. To make it dynamically resize the content of the Rect Transform based on the number of items, you either add a Horizontal Layout Group or a Vertical Layout Group to the Content Gameobject along with a Content Fitter component set to Preferred setting. Then to dynamically load objects in through code you can get a reference to your prefab, the list of items or images you want to spawn, loop over them and spawn them under the Content transform, and do other processing.
โบ๐ Relevant Video Links ๐
โบKenney UI Pack: Space Expansion
https://www.kenney.nl/assets/ui-pack-space-expansion
โบKenney Pixel Shmup
https://www.kenney.nl/assets/pixel-shmup
โบโฑ๏ธ Timestamps โฑ๏ธ
0:00 Intro
0:05 Set up ScrollView
1:42 Horizontal Layout Group
3:53 Content Fitter
5:48 Dynamically Add Items Through Code
10:31 IPointerClickHandler
11:19 Outro
๐๐THANK YOU TO ALL MY PATRONS ๐๐
โฏโฏโฏ My Links โฎโฎโฎ
๐ Patreon ๐
patreon.com/samyg
๐ฌ Discord Server ๐ฌ
discord.gg/SwCKB3Q
๐ฆ Twitter ๐ฆ
twitter.com/samyam_utube
๐ Facebook ๐
facebook.com/samyam.youtube
๐ Like and Subscribe! ๐
๐ฅ๏ธ Computer Setup ๐ฅ๏ธ
*As an Amazon Associate I earn from qualifying purchases.
amazon.com/shop/samyam
#unity3d #unitytutorial #gamedevelopment