Sprite color

When I place this script on a sprite I want it to change color on mouseover but instead all the sprites (that have this script) change color as well. Im doing something terribly wrong here but I cant see it :confused:

using UnityEngine;
using System.Collections;

public class SpriteMouseOver : MonoBehaviour {
	
	//private SpriteRenderer spriteRenderer;
	public Color highlightColor;
	Color normalColor;
	
	void Start () {
		//spriteRenderer = gameObject.GetComponent<SpriteRenderer> ();
		normalColor = gameObject.GetComponent<SpriteRenderer> ().color;
	}
	
	// Update is called once per frame
	void Update () {
		
		Vector2 mousePos = new Vector2(Camera.main.ScreenToWorldPoint(Input.mousePosition).x,Camera.main.ScreenToWorldPoint(Input.mousePosition).y);
		RaycastHit2D hit = Physics2D.Raycast (mousePos, -Vector2.up, 0f);
		
		if (hit.collider != null) {
			gameObject.GetComponent<SpriteRenderer> ().color = highlightColor;
		} else {
			gameObject.GetComponent<SpriteRenderer> ().color = normalColor;
		}
	}
}

You can use OnMouseEnter and Exit; but it will not work on Mobile.

Update function is executed on all game objects and when there is a hit (it does not matter what it hits); all of them change it’s colour.
You should also add if it hits to current game object; see the if clause:

	if (hit.collider != null && hit.collider.gameObject == gameObject) {
      gameObject.GetComponent<SpriteRenderer> ().color = highlightColor;
	} else {
	  gameObject.GetComponent<SpriteRenderer> ().color = normalColor;
	}