Hi everyone,
Slowly trying to learn through the many examples and active Unity Community - getting a little stuck on something, though:
I want a player to hit an object and activate an instantiation that creates many more objects.
I did something to the extent of the following, but it is not working:
void OnTriggerEnter(Collider other)
{
if (other.tag == "Player")
{
for (int i = 0; i < 200; i++)
{
Instantiate(prefab, new Vector3
(Random.Range(-50, 50), -324,
Random.Range(-50, 50)), Quaternion.identity);
prefab.transform.localScale = Vector3.one * Random.Range(-8f, 8f);
}
Any ideas?