Hi i have made a simple scene in iphone where the user touches on the screen, a sound will play. However it does not play but freeze, if i disable the 2 lines where the sound is played, then the script works fine. Anyone knows what is going on?
[/code]
var sound1 : AudioClip;
var sound2: AudioClip;
var audioSource: AudioSource;
//**********************
function Update () {
transform.Rotate (0.1,0.3,0.3);
guitext.text = “Position : none”;
onTouch = iPhoneInput.touchCount;
if ( onTouch ) {
if (iPhoneInput.GetTouch(0).phase==iPhoneTouchPhase.Began) {
transform.localScale = Vector3(3.775,3.775,3.775);
audioSource.clip = sound1;
audioSource.Play();
}
if (iPhoneInput.GetTouch(0).phase==iPhoneTouchPhase.Ended) {
transform.localScale = Vector3(3.0,3.0,3.0);
}
guitext.text = “Position T0: X,Y axes”+iPhoneInput.GetTouch(0).position.x + " , " + iPhoneInput.GetTouch(0).position.y;
}
}
[/code][/code]