Hello. I searched up OnCollisionEnter2D and used the code it was provided with. I modified the code into
#pragma strict
function OnCollisionEnter2D(coll: Collision2D) {
if (coll.gameObject.tag == “Player”)
Destroy(gameObject);
}
However, when the object collides with the Player it doesn’t do anything. What am I doing wrong? I am making the game in 2D. I am also very new to Scripting and game creation.