How to create a vector randomly which keep a fixed distance to the vector zero.
code:
randomX = Random.Range(minRandomX,maxRandomX);
randomY = Random.Range(minRandomY,maxRandomY);
randomZ = Mathf.Abs(Mathf.Sqrt(radius * radius - randomX * randomX - randomY * randomY));
This code is running very slowly…