Hi, sorry if this is a noob question… I’m trying to make a boat game and I’m trying to figure out how to make the “fog horn” work. What I wan’t is that the sound is being looped when you hold the gui button down (It’s an Android game). And when you release the gui it should stop the sound. This is my current code:
if(GUI.Button(new Rect(Screen.width - (TurretBtnAverage * 2),0,TurretBtnAverage,TurretBtnAverage),"", HornBtnGUIStyle)) {
hornSound.audio.Play(); // hornSound is the gameObject where the audioClip is attachted to :-)
}
Thanks, Andreas