- Home /
Question by
SimuStudios · Jan 20, 2018 at 07:53 PM ·
scripting problembug
Instantiated UI elements not rendering on canvas
I have a inventory screen that will upon start instantiate the inventory slots. The problem I’m having is by default the canvas component of the canvas game object is set to disabled. When I then re-enabled the canvas component upon opening the inventory, the instatiated elements don’t render, but all the other elements do. Any ideas on how to fix this?
Comment
When you instantiate your elements, are you assigning the canvas gameobject as their parent?
Answer by FlightOfOne · Jan 20, 2018 at 09:18 PM
What if you disable and re-enable the inventory slot AFTER you enable the canvas?
The inventory slots are always enabled. They are basically invisible upon opening the inventory, unless the inventory was open when they were instantiated.