public GameObject prefab;
Collider obj;
private bool onTrigger = false;
void OnTriggerEnter(Collider other)
{
obj = other;
onTrigger = true;
}
void FixedUpdate()
{
if (onTrigger == true)
{
Instantiate(prefab, obj.gameObject.transform.position, Quaternion.identity);
onTrigger = false;
}
}