- Home /
[Unity5 C#] OnTriggerEnter not working
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 ?
1.png
(377.2 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220611225754im_/https://answers.unity.com/themes/thub/images/avi.jpg)