Hi, I’m trying to make it so that a short button sound plays once when the mouse enters the GUItexture. This is the script I have attached to the GUItexture buttons:
private var soundHighlight;
function Start ()
{
soundHighlight = GameObject.Find("SoundButtonHighlight");
}
function OnMouseEnter ()
{
audio.PlayOneShot(soundHighlight);
}
Although when I move the mouse over the GUItexture it gets an error saying: InvalidCastException: Cannot cast from source type to destination type.
Any other variations I tried of the script it just throws a tantrum.