i wrote this code so that it enable a game object when it collides with water but it dosent seems to work
using UnityEngine;
public class particleEnabler : MonoBehaviour
{
public GameObject a;
void OnCollisionEnter(Collision h)
{
if (h.collider.tag == "water")
{
a.SetActive(true);
}
}
void OnCollisionExit(Collision h)
{
if (h.collider.tag == "water")
{
a.SetActive(false);
}
}
}
pls help