I have this function that moves the object around a circle:
void arrangeCardsInHand(Player newPlayer){
int numCards = newPlayer.Hand.Count;
var centrePos = new Vector3(0, 300 ,0);
for (var cardNum = 0;cardNum < numCards;cardNum++) {
var i = (cardNum * 1.0 / numCards);
//angle in radians, full circle has a radian angle of 2PI, so we find the radian angle between
//2 of our points by dividing 2PI by the number of points
var angle = (float)(i * Mathf.PI * 2);
var radiusX = 10000.0;
var radiusZ = 4300.0;
var x =(float)( Mathf.Sin (angle) * radiusX);
var z = (float)(Mathf.Cos (angle) * radiusZ);
var cardName = newPlayer.Hand[cardNum].cardName;
GameObject.Find(cardName).transform.position = new Vector3(x, 0 ,z) + centrePos;
}
}
I want the cards to be arranged in the top arc of the circle (1/4 of a full circle).
I have no idea how to work out the starting and the ending point into this formula tho.
I’m also open for other ideas (like beziers or w/e) if you think this is not the best solution for what I want to do.
Any answer is appreciated.