- Home /
Turned out the Audio Clip was set as a 3d sound when it should have Not Been set to 3d sound.
2nd Audio Clip Not Playing
My Debug line is working so I know it's reaching that pint but for some reason the audio clip does not play? Here is my code:
using UnityEngine;
using System.Collections;
public class MicroJamSwirlManagerScript : MonoBehaviour {
// Sound FX Array
public AudioClip MicroJamSwirlFX;
public AudioClip KITTVoice01;
public AudioClip KITTVoice02;
//Assign Animation Controller
public Animator MicroJamSwirlAni;
void Start (){
//initializes micro Jam Sound FX
audio.clip = MicroJamSwirlFX;
audio.loop = true;
//audio.Play();
audio.PlayOneShot(KITTVoice01);
//Start Animation Delay
StartCoroutine(Wait());
StartCoroutine(Wait02());
StartCoroutine(LoadAfterDelay2("KnightSpinningLogo_NoKITTintro"));
//initialize Micro Jam Animation Loop
//MicroJamSwirlAni.SetBool("MicroJamSwirlOff", !MicroJamSwirlAni.GetBool("MicroJamSwirlOff") );
}
public IEnumerator Wait(){
yield return new WaitForSeconds(1.5f);
MicroJamSwirlAni.SetBool("MicroJamSwirlOff", !MicroJamSwirlAni.GetBool("MicroJamSwirlOff") );
audio.Play();
}
public IEnumerator Wait02(){
yield return new WaitForSeconds(2.1f);
audio.PlayOneShot(KITTVoice02);
Debug.Log("exicuted This Line");
}
IEnumerator LoadAfterDelay2(string levelName){
yield return new WaitForSeconds(5.5f); // wait 1 seconds
Application.LoadLevel(levelName);
}
}
I don't remember if the clip that you want play must be in audio.clip field or in audio.clips array.
$$anonymous$$aybe i wrong...
Yeh it's confusing, the sour effect plays and loops as it should, the first voice clip plays but the one above the Debug.log does not play? Can't figure out why.
maybe that audiosource component can play only one clip at time?
Well the audio source is playing the other two sounds from the array just fine, so I'm not sure it's that.?
Sunofa....!! turns out I had the audio clip as a 3D sound when that should have been set to off.... Dang!! Solved!
Follow this Question
Related Questions
How Do I Get This To Play Sound? 0 Answers
How to make audio not playing repeatedly? 1 Answer
How do I play audio source on Maximize on Play / Audio Source wont play on Maximize 0 Answers
Stop audio from looping and play at lower volume 1 Answer
How can I play audio clips depending on the players movement 0 Answers