# Coins don't show up in game in Unity

I have a 2D game I'm making with Unity, and I want the player to be able to collect coins that I place all over the game. I used the coin prefab with a 2D circle collider and an animation to make it spin. The problem is that only the first coin I put into the scene shows up in the game, and when I collect that one coin, the counter shows that all the others have been collected as well. Here's the script I attached to the player for the coins:

private uint tokens = 0;

void OnGUI(){
GUILayout.Label ("Tokens= " + tokens);
}

void CollectToken(Collider2D tokenCollider){
tokens++;
Destroy (tokenCollider.gameObject);
}

void OnTriggerEnter2D(Collider2D col){
if (col.gameObject.CompareTag ("token")) {
CollectToken(col);
}
}


This is my current setup for the object properties:

Thank you for any help!

• Did you check that you're not moving the position of every coin to one position? – Elva Jan 15 '15 at 16:53
• I have them in different positions in the scene, and when the game loads it looks like they either disappear or they all move to the position of the first coin – Jordan Jan 15 '15 at 16:56
• Yes, did you check if the last thing isn't exactly what happens, and if it does debug why that is happening? Cause it's not in any of the code presented here. – Elva Jan 15 '15 at 17:06
• It turns out it's the latter, all the prefabs are moving to one position. I've added a screen shot of the inspector, the prefab's position is set at 0, but it changes to this when I play – Jordan Jan 15 '15 at 17:18