Hello,
I made created GUI Text and attached a C# script with the following code below:
using UnityEngine;
using System.Collections;
public class BtnHome : MonoBehaviour
{
void OnMouseEnter()
{
renderer.material.color = Color.red;
}
void OnMouseExit()
{
renderer.material.color = Color.white;
}
}
Like it says above, the text should turn red when the mouse hovers over the text and should turn white when it hovers off the text.
However, that doesn’t happen. So, how do I fix this?