I have this code:
public AudioClip sounds;
private AudioSource[] ASources;
void Start () {
ASources = new AudioSource[1];
ASources [0] = gameObject.AddComponent<AudioSource> ();
ASources [0].clip = sounds;
ASources [0].UnPause ();
}
And when i play the game, when i check the object i see the audio in the component but its not playing and when i type Debug.Log(ASources [0].clip); in update it returns null even though when i check in inspector, it’s there!