Unity UI Tutorial - How to make a scrollable list

zero3growlithe · 225K views · 2015 · 7:44

Open on YouTube

Indie game developmentGame programming & enginestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about building scrollable or sliding button lists and menus in Unity with the built-in UI components instead of OnGUI.

Recommended by 2 people across 2 different months, 2015 to 2017.

What it is

A short 2015 screencast showing how to build a scrollable list with Unity's UI system, using a scroll rect with a layout group and button prefabs. It is a quirky, subtitle-only walkthrough by the channel zero3growlithe, with background music.

What people said

Recommends Berke Cagkan Toptas · 2015-08 · Stack Overflow · on “Unity3d: How to create a sliding(by touch) list?”

Here there is a [this video] how to make a basic sliding menu. For list element, probably you will need more than a button. If this is the case, you can create an empty object name "listItem" and design a list item with texts, buttons, images etc. After that turn this object into a prefab.Then you can add element layout to the listItem instead of button as seen in the video. Here there is an example screenshot: [LINK]

Recommends Lukáš Hejtmánek · 2017-03 · Stack Overflow · on “Creating a scrollable button list menu in Unity from C# scripting”

If its in game, I don't recommend OnGUI, rather use the Unity UI components. There is good video on how to create scrolalble lists here: [this video] You can add buttons to the vertical or horizontal group easily from editor or from code. You just instantiate button prefabs and place them inside the horizontal group parent. GameObject horLayoutGroup; GameObject buttonPrefab; var myButton = Instantiate(buttonPrefab, new Vector3(default), Quaternion.identity); myButton.transform.SetParent(horLayoutGroup.transform) this will automatically scale the entire layout group and place everything neatly next to each other, without having to play with pixel offset. If you want to add a function to a button,

Cites Lord_Johnsson · 2016-02 · Stack Overflow · on “Unity GameObject position z is mysteriously changed after object is created in script”

I have once again problems with Unity. I can't spear much code due the level of secrecy agreement in the game I'm working on but I ran to this one annoying problem when running my code. SO, I'm creating GameObjects in runtime when entering a certain view in the game. I have created a so called Reader for our game story which reads text from database, splits it to paragraphs, creates GameObject around that paraghraph text (setting text components etc. to it) and then adds that GameObject and its text to a story panel that shows all the objects as a scrollable view inside masked panel. Hopefully you can keep up with my explanations :D Everything works fine all the way to the point that the par

Cites Salvador Lemus · 2017-03 · Stack Overflow · on “Unity 5 3d Shop menu with prefabs”

I'm going to assume that every pink rectangle is a prefab. First, you need to understand the concept of prefabs [LINK] . Second, you need to know how to instantiate [LINK] a prefab in run time. Third, you need to acces the properties [LINK] for your new fresh instantiate game object so you can change the information of that prefab if you want, maybe you want some values to be 200 instead of 100, idk. Finally, ther's no "right way" to achieve this, but I recommend you to use Unity UI and scroll rect [this video] to achieve your goal. If you have some time to experiment there will be a good idea to check out a pooling [LINK] system so you doesn't need to use so much memory at instantiate and destro