Kurukshetran
11/4/2015 - 2:53 AM

PrefabGenerator

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);
  }

}