I am trying to call onTriggerEnter (onCollisionEnter is also fine) but it doesn’t seem to be working.
I have already checked this answer but still couldn’t solve the issue.
this is my particleCollision
code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
public class ParticleCollision : MonoBehaviour
{
public UnityEvent onCollect = new UnityEvent();
void onTriggerEnter(Collision collision)
{
Debug.Log("Trigger Succeeded!!!");
// if (collision.gameObject.tag == "Player")
// {
gameObject.SetActive(false);
onCollect.Invoke();
// }
}
void onCollisionEnter(Collision collision)
{
Debug.Log("Collision Succeeded!!!");
// if (collision.gameObject.tag == "Player")
// {
gameObject.SetActive(false);
onCollect.Invoke();
// }
}
}
I tried turning off “is Trigger” and using onCollisionEnter but it still had no reactions.
Is there anything else I could be missing?