I am developing a game for cards. I have a deck of cards. want to display the cards like an arc shape. I have implements it but its showing all the cards in deck horizontally by using horizontal layout group script provided by unity. I am trying to use game object with vector3 function by giving it custom X and Y but it has no effect. Below is the code i am trying
GameObject DealCard(float x,float y)
{
if(hand.Count >= 13)
{
//showReset = true;
return null;
//Alternatively to auto reset the deck:
//ResetDeck();
}
GameObject handObject = GameObject.FindWithTag("handObject");
int card = Random.Range(0, cards.Count - 1);
GameObject go = GameObject.Instantiate(deck[card]) as GameObject;
go.transform.SetParent (handObject.transform,true);
go.transform.position = new Vector3(x+((float)cardsDealt / 4), y+((float)cardsDealt / -4), (float)cardsDealt / -4); // place card 1/4 up on all axis from last
//go.transform.position = new Vector3(200, 300, (float)cardsDealt / -4); // place card 1/4 up on all axis from last
cards.RemoveAt(card);
//Debug.Log(transform.parent.gameObject.tag);
Debug.Log(x +"," + y);
if(cards.Count == 0) {
showReset = true;
}
return go;
}