I have a model with a rigidbody attached and I change the material in OnMouseEnter and OnMouseExit. It works correctly when I don't hold the mouse button down, but when I do have any mouse button held down and I drag over the object it flickers. Is this a known bug or am I doing something wrong?
Edit: added code
void OnMouseEnter()
{
if (sCurrentHoverSlot == null)
{
sCurrentHoverSlot = this;
gameObject.renderer.material = GUIManager.instance().weaponSlotHoverMaterial;
}
}
void OnMouseExit()
{
if (sCurrentHoverSlot == this)
{
sCurrentHoverSlot = null;
gameObject.renderer.material = GUIManager.instance().weaponSlotDefaultMaterial;
}
}