OnTiggerEnter/OnTriggerExit is called twice

I’m trying to increase an integer by 1 whenever the player collides with a trigger, but instead it increases by 2, which means the function is called twice. I put comments next to where I made necessary changes to get what I want. But I’m asking this for several purposes in the future. Here’s the code:

var PortalActive : boolean = false;

static var PortalCount : float = 0; //Was originally int, but I changed it so it accepts 0.5

function Start () {
	gameObject.renderer.material.color.a = 0.75f;
}

function OnTriggerExit (collision : Collider) {

	if (collision.gameObject.FindWithTag ("Player")) {
		if (!PortalActive) {
			PortalActive = true;
		
			gameObject.renderer.material.color = Color (0, 1, 0, 0.75);
			gameObject.particleSystem.startColor = Color.green;

			PortalCount += 0.5; //Was originally 1, but I changed it to 0.5 so I can get 1
			
		}
	}
}

for a start, change
if (collision.gameObject.FindWithTag (“Player”)) {
to
if (collision.gameObject.tag == “Player”) {
Doesn’t make sense to perform a find operation when you already have a reference to the object

Is there only one instance of this script?

Whoops, it turns out that I added the script twice.

Thanks for pointing that out.