Raycast2D always "remembers" it's last hit

Hello.

I have multiple 2D sprites in my scene and I got GameObject that just tracks mouse and checks if it hovers the other GameObjects with colliders:

	void Update () {
		Vector3 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition); 
		RaycastHit2D hit = Physics2D.Raycast(pos, Vector2.zero);

		if (hit.collider != null) {
			Debug.Log("YES");
		} else {
			Debug.Log("NO");
		}

	}

So when I first launch my scene it shows NO. But after it hits one of theese objects its says YES and not change even if my mouse does not goes over another objects anymore. What I have missed? I know that there is OnMouseEnter, OnMouseLeave functions, but I do not want to write it to every script.

I have found solution. It Actually shows me YES and NO in situation that I want. Editor groups messages from Debug.Log that are same in one row and just shows its numbers. Then it sorts it alphabeically and when maximize on play is turned on it always shows me the LAST message.

This made me to think that Debug.Log always shows me YES. How I found it out? I just made counter and attached it like that:

if (hit.collider != null) {
Debug.Log("YES " + counter);
} else {
Debug.Log("NO " + counter);
}

When I started the game now It showed me what I want. So, I am sorry for wasting your time, anyway thank you for attention.

Another way to do this is instead of using a debug.log, use a print statement… it doesnt seem to group those… found this issue with grouping myself… print is just easier than using a counter variable…