using UnityEngine;
using System.Collections;
public class packs : MonoBehaviour {
[SerializeField]
private GameObject pack;
[SerializeField]
private GameObject sPoint;
void OnTriggerEnter(Collider toxunan)
{
if(toxunan.gameObject.tag=="Player")
{
Instantiate(pack, sPoint.transform.position , sPoint.transform.rotation);
Destroy(this.gameObject);
Destroy(sPoint);
}
}
}
Please help me how to fix this ?