Hello Everyone!
I’m having an issue when I try and instantiate a new button at runtime. The relevant code is:
public Button button;
void Start()
{
GameObject go = Instantiate(button) as GameObject;
}
Yields the error:
Assets/Scripts/DraftingScript.cs(122,61): error CS0039: Cannot convert type UnityEngine.UI.Button' to
UnityEngine.GameObject’ via a built-in conversion
I couldn’t find anything relevant to buttons out there. Any help is appreciated!
~Maxw3ll