Boolean value returns both true and false

Hello. =)

I’ve been trying to make an NGUI sprite change between 2 sprites based on a boolean function.

void Update () {
	if(CanSeeTarget())
		Detection.GetComponent<UISprite>().spriteName = "SeenIndicatorGreen";
	else
		Detection.GetComponent<UISprite>().spriteName = "SeenIndicatorRed";
	}

With that code it appears to always be returning false and going to the else statement, because if I was to remove the else statement entirely, the sprite would change accordingly when the enemy sees the player, but not go back to the unseen sprite (obviously).

For debugging purposes and lack of any solution, I wrote the following:

void Update () {
	print(Time.frameCount);
	if(CanSeeTarget())
		print(CanSeeTarget());
	else
		print(CanSeeTarget());
}

With that code I am getting very strange results:

At frame 146 the player was no longer seen by the enemy.
Yet, before that, when he could, it would output both true and false every frame!
And furthermore it looks like it’s running through the code twice per frame.

Please someone find SOME solution, this is getting pathetically frustrating. Be extra blunt if it was indeed mere stupidity.
Thanks =)

That means you have the script attached to two objects. If the output indicates that it’s running twice, then yeah, it’s running twice.