Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
void InstantiateSmallCubeInSphere(){
for (int i = 1; i <= batchNum; i++){
Vector3 position = Random.insideUnitSphere;
position.x *= cubeSize.x / 2f;
position.y *= cubeSize.y / 2f;
position.z *= cubeSize.z / 2f;
position += offset;
// Prefabをインスタンス化する
GameObject obj = Instantiate(cubePrefab, position, Quaternion.identity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.