FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionPlaying Audio script?

more_horiz
Help me guys i need a script that replays a .mwv or mp3 audio file but waits a few seconds before the replay. Does any body knows how to make that possible?  Question 

descriptionRe: Playing Audio script?

more_horiz
Try the following C# code:
using UnityEngine;
using System.Collections;

public class Audio : MonoBehaviour {

// Use this for initialization
void Start () {
StartCoroutine (PlayAudio ());

}

IEnumerator PlayAudio(){
while(true){
yield return new WaitForSeconds (3f);
audio.Play ();
}
}
}
Permissions in this forum:
You cannot reply to topics in this forum