PrefabGenerator
using UnityEngine;
using System.Collections;
public class PrefabGenerator : MonoBehaviour
{
public GameObject prefab;
public Transform position;
public string triggerTag;
void OnTriggerEnter(Collider other)
{
if(other.tag == triggerTag)
Instantiate(prefab, position.position, Quaternion.identity);
}
}