Hey everyone,
I'm trying to write up a script so that when a player is within a certain range of any item it slides towards the player and destroys on collision
The thing is I cant even get the OntriggerEnter or OnCollisionEnter to work and not sure why
void OnTriggerEnter(Collider other) {
if(other.gameObject.CompareTag("item")) {
Debug.Log("You've Collected an item!");
Destroy(other.gameObject);
}
}
Would anyone be able to give me a heads up? I'm coding in C# not JS