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.