I’m passing a clip to play on the audio supply. Subsequent hyperlink I look ahead to the audio to complete to invoke the subsequent motion. nevertheless it’s not accomplished. As soon as the audio clip ends the time begins from the start with out taking part in the clip. So examine the situation “audiosource.isPlaying” is getting fail, so it stays on the loop.
IEnumerator PlayAudioClip(AudioClip clp) { audioSource.clip = clp; audioSource.Play(); whereas (audioSource.isPlaying) { Debug.Log("Time: "+audioSource.time + " > " + clp.size); yield return new WaitForEndOfFrame(); } //Performing some motion }
Error:
The error screenshot is hooked up. You should utilize this hyperlink to see the identical https://drive.google.com/file/d/1GCJ743gIpkSFZN6F86dG2IwhHUQAnJgY/view?usp=sharing
Notice: It is working within the editor. Not working solely within the WebGL Construct.
I’m utilizing Unity 2021.3.5f1