Hi all! Still very new to development, but I’m in need of some guidance. I am looking to take a randomly drawn card, and add it to an existing parent (a plane on my UI). However, I’m unsure how to assign the new card to a specific parent. I copied the code from a tutorial, but I want to change it up a bit slightly. I’m trying to add the card to the “Hand” parent.
Can somebody help walk me through this? Below is the code, and I have attached a screenshot of my editor:
void MoveDealtCard()
{
GameObject newCard = DealCard();
// check card is null or not
if (newCard == null) {
Debug.Log("Out of Cards");
showReset = true;
return;
}
//newCard.transform.position = Vector3.zero;
newCard.transform.position = new Vector3((float)cardsDealt / 4, (float)cardsDealt / -4, (float)cardsDealt / -4); // place card 1/4 up on all axis from last
hand.Add(newCard); // add card to hand
cardsDealt ++;
}