UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"Start Audio1. After Audio1 end, Start Audio2 and loop immediately."
using UnityEngine; public class AudioController : MonoBehaviour { public AudioSource audioSource1; public AudioSource audioSource2; void Start() { audioSource1.Play(); StartCoroutine(PlayAudio2AfterAudio1()); } System.Collections.IEnumerator PlayAudio2AfterAudio1() { while (audioSource1.isPlaying) { yield return null; } audioSource2.loop = true; audioSource2.Play(); } }