- Home /
instantiating child objects the same way they are layed out in a prefab
So im making a not so standard gui (not using mouse input at all) so im setting it up so that the buttons could potentially be changed to actual game objects later, and therefore cannot use any of the normal GUI functions. Anyway, im making my own drop down menu, basically i have one button that when pressed, will instantiate 4 more buttons underneath it. I have them all layed out the way i want them to look in the prefab, but i dont want the drop down buttons to be visible until the parent button is pressed. so my question is... do i have to code the localPositions in when i instantiate them or is there a way i could instnatiate them based off where there position is from their layout in the prefab? ...i hope this question is clear
Ins$$anonymous$$d of instantiating the buttons just toggle their visibility and touchability. Start as untouchable and invisible.
Answer by applemaniac · Jul 07, 2015 at 07:08 AM
You can have them already in your scene but not active and use GameObject.SetActive(true).
Your answer
![](https://koobas.hobune.stream/wayback/20220611230134im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
onValueChanged Dropdown in loop 2 Answers
Gui object to mouse position 1 Answer
Creating Dropdown GUI 1 Answer
Positioning a GUI Text? 2 Answers
Simple Drop down list 1 Answer