I am trying to procedurally spawn a LOD group, but when I put it as my GameObject to be copied, it doesn’t work. I have verified that it works with a normal GameObject. I cannot figure out how to call on an LOD group instead of a GameObject. Any help appreciated.
My Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spreader : MonoBehaviour
{
public GameObject itemToSpread;
public int xvalue = 7;
public int yvalue = 8;
public int zvalue = 10;
public int zvalue2 = 15;
void Start()
{
spreadItems();
}
void spreadItems ()
{
Vector3 randPosition = new Vector3 (Random.Range(-xvalue, xvalue), Random.Range(-yvalue, yvalue), Random.Range(zvalue, zvalue2));
GameObject clone = Instantiate(itemToSpread, randPosition, Quaternion.identity);
Debug.Log("Spawned");
}
void Update()
{
}
}