How to delay music in scene?

Greets!

I want to delay the music of my scene 15 sec after start, got this script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DelaySound : MonoBehaviour
{
    public AudioSource myAudio;
    // Use this for initialization
    void Start () {

        StartCoroutine(PlaySoundAfterDelay(myAudio, 15000f));
    }

    // Update is called once per frame
    void Update () {

    }

    IEnumerator PlaySoundAfterDelay(AudioSource audioSource, float delay)
    {
        if (audioSource == null)
            yield break;
        yield return new WaitForSeconds(delay);
        audioSource.Play();
    }

}

but the music still start at the beginin of the scene…

Any help?

maybe autiosource has [×] play on awake?

note: delay value should be in seconds

1 Like

Yes, it has play on awake… :s Was wonderin also why it wasn’t in sec… Cheers!