I have programmed in my game that when you pick up a paper it disappears, shows a quick GUI and plays an audio clip of a page turning. The script itself seems to be working properly, but when the audio clip plays it sounds like a knife being sharpened on a rock more than the sound of a page turning! Here is my script, if any body could explain this and leave a possible solution that would be great! Thanks!
var objective1 : boolean = false;
var objective2 : boolean = false;
var objective3 : boolean = false;
var objective4 : boolean = false;
var objective5 : boolean = false;
var texture1 : Texture;
var texture2 : Texture;
var texture3 : Texture;
var texture4 : Texture;
var texture5 : Texture;
var audio1 : AudioClip;
function OnGUI()
{
if(objective1 == true)
{
GUI.DrawTexture(Rect(800,100, 300,512), texture1);
objectivedis1();
audio.PlayOneShot(audio1);
}
if(objective2 == true)
{
GUI.DrawTexture(Rect(10,10, 750,150), texture2);
}
if(objective3 == true)
{
GUI.DrawTexture(Rect(10,10, 750,150), texture3);
}
if(objective4 == true)
{
GUI.DrawTexture(Rect(10,10, 750,150), texture4);
}
if(objective5 == true)
{
GUI.DrawTexture(Rect(10,10, 750,150), texture5);
}
}
function objectivedis1()
{
yield WaitForSeconds (3);
objective1 = false;
}