I need to spawn 1-4 players at points around a bezier curve surrounding a basketball net (so around a 3-point line, essentially). This will be an AR environment, so there will be no actual 3-point line in the scene - I need a way to spawn a given number of players at equal distances from each other. So if there are 2 players, they will be placed at 10 and 2 of a clock-face. 4 players will be placed at roughly 9, 11, 1, and 3 of a clock-face.
Note: No player can be on the top of the oval (directly facing the net), as this would be an unfair advantage.
bezier curve is more complex,
but if you want to choose points on an arc it’s pretty simple.
// return a point on the unit circle lying in the XZ plane,
// uniformly distributed between degreesA and degreesB.
// "0 Degrees" is taken to be Vector3.forward, aka [0, 0, 1].
Vector3 PointOnArc(float degreesA, float degreesB) {
float deg = Random.Range(degreesA, degreesB);
return Quaternion.AngleAxis(deg, Vector3.up) * Vector3.forward;
}
I haven’t actually compiled that, but it should work.
Note you’ll need to scale the result by the size of that semi-circle,
and translate it by the center of the semi-circle.