Script for making instance of object delete itself is not doing anything.
Hello, I'm trying to make a simple ball rolling game as I am watching a tutorial series about it, but the guy in the video just got into making collectibles, which requires the "coin" object to delete itself upon being touched by the ball that is being controlled by the player. I am pretty certain that I made the script exactly as he made it and it is not giving an error, just not doing anything when the player touches the coin. The tutorial I am watching is a few years old, So I assume that it is not working because something has changed since then, so hopefully someone could take a look at the script and tell me if they see an obvious issue with it. Thanks.
#pragma strict
function OnTriggerEnter (Info : Collider) {
if (Info.tag == "Player"){
Destroy(gameObject);
}
}
Your answer
Follow this Question
Related Questions
my counter wont change from 0 help 1 Answer
Need help with bone animation and trigger code. 0 Answers
OnTriggerEvent doesn't work 1 Answer