Coin collecting with prefabs

Hi all,

In a level of a game I’m currently making, the player (which is a prefab object) has to collect coins (prefabs also). The script I’m trying to get working will ideally destroy the coin on collision. Basic enough.

However, the current code I’m using will (when altered) destroy the player on impact, but not the coin (when I change it back to read ‘Coin’ instead of ‘Player’; this was merely to see if it was working).

Anyone know why the devil this’d be happening? I can’t find out, no matter what boxes I tick/untick… it just won’t work. Is it a double prefab thing?

Thanks again, any suggestions welcome.

using UnityEngine;
using System.Collections;

public class AsteroidCollision : MonoBehaviour
	void OnCollisionEnter(Collision other)
		if( == "Coin")
			Debug.Log("Congratulations - You Collected 1 / 10 Coins!");

Does the coin have a collider set with IsTrigger?

AH!!! Thanks a bunch Scribe you absolute beast! The tag trick worked fine! That must’ve been it. You’re an absolute legend man.