- Home /
Question by
carranza01 · Aug 11, 2016 at 01:08 PM ·
c#instantiatebutton
when instantiate a button it doesnt keep the scripts I asigned;
I created a prefab of a UI menu with a lot of buttons, i have asigned the script i need in the editor and save the prefab, but when i instantiate it all the scripts i asigned are gone...
how i can instantiate it without loosing the scripts??
public void openMenuFaces()
{
Destroy(GameObject.FindGameObjectWithTag("facesMenu"));
GameObject a1 = Instantiate(faces) as GameObject;
a1.transform.SetParent(ClothMenu.transform,false);
a1.transform.position.Set(0, 0, 0);
}
Comment