Instantiate panel background not showing
I'm making an app to help-me with my RPG sessions. So i want to make multiple character sheets available to me at the same screen but when i try to instantiate a UI prefab the backgound just vanish.
This is the code that i am using
GameObject newWindow = Instantiate (enemyWindow, new Vector3(640,300,0), Quaternion.identity) as GameObject;
newWindow.transform.parent = GameObject.Find("Canvas").transform;
This is what happens.
Sorry for any mistake in the post. (and english) Its the first question that i'm making here and this is the first program that i'm making.
Answer by LindermanBR · Mar 25, 2016 at 05:21 PM
I was able to find an answer.
Somehow when i use newWindow.transform.SetParent(parentObject.transform, false); instead of newWindow.transform.parent = GameObject.Find("Canvas").transform;
It works I don't know why since i'm noob in programming but when i assign the canvas to the parentObject and use the first way the Background shows normally.