Question by
SlobbishBurrito · Jan 09, 2020 at 02:54 PM ·
audioaudiosourceaudioclip
Audio Clip not working in AudioSource
I have been trying to pass this audio clip to play after 10 seconds but every time unity tries to play the clip, it will not play. However, it will play when I click and hold the border of Unity. I am not sure if this is a bug in Unity or something that I am doing wrong. I have looked at my audio settings and nothing is out of the normal. I am using Unity 2019.2.7f2 personal version.
public AudioSource audioManager;
public AudioClip sirenOn;
void Start()
{
audioManager = GetComponent<AudioSource>();
StartCoroutine(BeginVoiceNow());
}
// Update is called once per frame
void Update()
{
GameObject cylinderOne = GameObject.Find("SealSnap1");
SnapObject snapObject = cylinderOne.GetComponent<SnapObject>();
if (snapObject.timesActivated == 3)
{
StartCoroutine(LifeSupportEnd());
}
}
IEnumerator LifeSupportEnd()
{
yield return new WaitForSeconds(10);
audioManager.clip = sirenOn;
audioManager.Play();
yield return new WaitForSeconds(10);
turnOffLights.SetActive(false);
turnOnRedLights.SetActive(true);
enableEvac.SetActive(true);
disableBlueScreen.SetActive(false);
}
IEnumerator BeginVoiceNow()
{
yield return new WaitForSeconds(6);
audioManager.Play();
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612221304im_/https://answers.unity.com/themes/thub/images/avi.jpg)