collison scoring

i made a script that would increase the coin counter by 1 everytime it collides with a coin but my script either adds 2 or doesnt do anything. Anyone know how to fix this script?Thanks

public int coin = 0;

public GUISkin myskin;

void OnTriggerEnter(Collider other)
{
	if (other.gameObject.tag == "coin") {
		coin += 1;

	}
}

void OnGUI()
{ 

	GUI.skin = myskin;
GUI.Label(new Rect(200,10,200,100), "Coins:" + coin);
}

Hi! I just did something like this and works fine

void OnTriggerEnter2D(Collider2D other) 
	{
		if (other.gameObject.tag == "coin") 
		{

			coin ++;
			
		}
	}

instead of making it +=1 just make it ++ . Also make your the coin is a trigger collider then . I also did it with 2D so please bare in mind also.