arrange ui in semicircle
Hello everyone I am trying to arrange ui objects in a semicircle while rotating around it (a hand of cards). I have planed on doing it with degrees. I know that you can get the degrees using the atan2 function and set them with a for loop. I have set up a hand object with a list of the cards in the hand. I just don't understand do I use the hand transform in the atan2 to get the degrees.
degrees = Mathf.Atan2(hand.transform.position.x, hand.transform.position.y) * Mathf.Rad2Deg;
degrees = (degrees + 360) % 360;
then I need to set the cards based on it but am unsure how the for loop should go.
for(int i = 0; i < cardsInHand.Count; i++)
{
cardsInHand[i].GetComponent<RectTransform>().anchoredPosition = new Vector3(/*not sure how to get the degrees to work with the vector 3*/);
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613035152im_/https://answers.unity.com/themes/thub/images/avi.jpg)