playing sounds after each other

hey guys,

I want to have 2 sounds playing on the same object on trigger, but after each other preferrably with a delay how to go about that in C#?

You can make a coroutine and use the yield return new WaitForSeconds(...) like this…

private IEnumerator PlaySounds ()
{
	// Play the first sound

	AudioSource.PlayClipAtPoint(yourClip, transform.position);

	//Then wait 3 seconds and play the other

	yield return new WaitForSeconds(3);

	AudioSource.PlayClipAtPoint(yourClip, transform.position);
}

and then…

private void OnTriggerEnter ()
{
	StartCoroutine(PlaySounds());
}

worked like a charm! thanks a million :slight_smile: and so simple!