Instantiate objects around a sphere
I can not create an object on the sphere. It is necessary for the object to appear on the sphere I have class:
public class FoodGeneration : MonoBehaviour {
public GameObject foodPrefab;
public GameObject curFood;
void AddNewFood()
{
RandomPos();
curFood = GameObject.Instantiate(foodPrefab, curPos, Quaternion.identity) as GameObject;
}
void RandomPos()
{
Vector3 curPos = Random.onUnitSphere;
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612154445im_/https://answers.unity.com/themes/thub/images/avi.jpg)