OnMouseExit flickering

Hi, I’m somewhat new to Unity and I’ve been having trouble with OnMouseEnter/OnMouseExit. I’ve been searching around, sure that someone else must have had this problem before, but had no luck.

Basically, I have it so that an object turns red when moused over and blue when the mouse leaves. The problem is that whenever the camera changes, the object flickers between colors if selected, as if I had quickly moved the mouse off of the object and back on again, even if the mouse never left the object.

I don’t think I have a logic error, but here’s the code nonetheless:

public void OnMouseEnter () {
		isSelected = true;		
		renderer.material.color = Color.red;	
	}
	
	public void OnMouseExit () {
		isSelected = false;
		renderer.material.color = Color.blue;
	}

? Explain more, please.

Oh, sorry. I have a third person camera that follows the player. Whenever the player rotates the camera or moves (causing the camera to move with him), the flickering occurs.

I hate bumping but this fell past the first page. Any help would be greatly appreciated.