OnMouseEnter causes an object to disappear for some reason

I was trying to use OnMouseEnter and OnMouseExit to make a sprite change color when you have your mouse on or off it. OnMouseExit works as it should, but OnMouseEnter makes the object disappear instead of changing the color. Though when I hardcode the sprite to change to red in OnMouseEnter, it works fine. Here is the relevant part of the script:

public void OnMouseEnter()
    {
        //SprRender is a ref to the SpriteRenderer component
        SprRender.color = HighlightColor; //<- this somehow makes the sprite disappear
        
        //SprRender.color = Color.red; // <- this works as it should
        
    }

The skybox background is white, and the highlight color is blue, so I know it’s not the highlight color blending in with the background. Also, if it helps any, I’m using Unity 5.0.0f4.

How are you defining your HighlightColor?

The problem is that the alpha value of HighlightColor is set to 0.

If you are doing it something like this

public Color HighlightColor = new Color(0, 0, 0, 0);

then you are setting your transparency to 0. If you want to make the HighlightColor white you need to do it like this

public Color HighlightColor = new Color(0, 0, 0, 1);

or this

public Color HighlightColor = Color.white;

See the following Unity page for predefined color values