I want to make a main menu what when i hover the cursor over the text it makes a sound that indicate that it is selected and when i click it, it makes a sound also, how do i do so?
1 Answer
1function OnMouseEnter()
function OnMouseExit()
use that function to play the sound with
audio.Play(“Sound”);
Also make sure that you have AudioSource attached to the same object as the script is
function OnMouseClick()
Make a script and put all these methods together, but place this on a cube with a collider or on a 3D Text with a collider
this is great but can you use an exampe to display this to us by using two (2) vaaribles or sound input. ah Selection effect and confirm effect...
– Max_Designer
Read these: http://docs.unity3d.com/Documentation/Components/class-AudioSource.html http://docs.unity3d.com/Documentation/ScriptReference/AudioSource.html http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnMouseEnter.html
– Lockstep