- Home /
Gameobject as child of viewport content
Hi!
I´ve been trying to learn to code and while the actual coding part is going somewhat fluently, the Unity editor is giving me a headache. My problem is that I have a ItemObject-prefab that has lots of child buttons. This works perfectly but now i have to put this in a list. So there is going to be lots of these ItemObjects which all are differentiated by the itemID-property.
I have followed the Unity learn tutorial (Shop UI) and fiddled with Vertical Layout Groups on the content and Layout Elements on the Buttons but this doesn´t seem to work as intended. So my question is that is it at all possible to use this scroll view like this that I have custom gameobjects as child of content and under that I have the buttons? And I am just doing something else wrong.
Or do I have to restructure my code so that I have the buttons just under Content?
Below is a screenshot of my editor, which is highlighted to the ItemObject.
EDIT: So the problem is that if I duplicate these Gameobjects, the buttons just overlap.
Your answer
Follow this Question
Related Questions
using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers
ScrollRect content position is wrong in build 2 Answers
Stretching a gameobject to fit viewport 4 Answers
UI elements following GameObjects (3d world) 1 Answer
Adding a button to the content of the viewport in a scroll view through code? 0 Answers