Hey all,
I’m trying to change the parent of an object after instantiation but keep getting an error saying i’m unable to set the parent
public GameObject panel;
public HandCard cardPrefab;
public void AddCard(int index)
{
GameObject cardObj = Instantiate(cardPrefab.gameObject);
cardObj.transform.SetParent(panel.transform);
}
As a result I can see the new card has been created in the hierarchy view but it’s not been assigned a parent and can’t be seen in the game view.
Thanks in advance