Panels and U.I. + prefab instantiate loss of position

I have created a start menu with buttons and text for each button that fire events in my loader class to get the game started. However, i want to programatically show the start menu and then hide it, so I dragged the designed start menu a nested panel with buttons, into a prefab position. Then I pass that prefab into the Loader script and instantiate it. However, weird things occure. Only one of the buttons Text shows and VERY large, the rest of the start menu objects show a small red X in the designer view and there is no sign of any of it in the scene. Why does this happen?


When I use the button’s OnClick event to trigger the same object (main camera) that has the loader that loads the game up, i get 10000 different issues. If i just init the game without the start button it’s fine. Frustrating…

Ok I figured this out I just needed rest. When instantiating and setting to parent transform I added false argument to instantiate with local orientation. The weird null reference issues I was getting was strange. I was assigning camera as object in onClick, which had a loader script that takes a game manager prefab. I tried to daisy chain them using method in loader to call method in game manager onclick, and forgot to use the actual object and not the class to load a method (rookie) I also had to use button.onclick.addlistener because my buttons were instantiated at runtime.