- Home /
This question was
closed Feb 19, 2015 at 04:26 PM by
meat5000 for the following reason:
The question is answered, right answer was accepted
error CS0029: Cannot implicitly convert type void' to UnityEngine.AudioSource'
public AudioSource MenuMusic;
void Awake () {
MenuMusic = GameObject.Find("Menu Music").GetComponent<AudioSource> ().Stop();
}
I get an error:
error CS0029: Cannot implicitly convert type void' to UnityEngine.AudioSource'
Comment
Best Answer
Answer by meat5000 · Feb 19, 2015 at 04:20 PM
private AudioSource MenuMusic;
void Awake () {
MenuMusic = GameObject.Find("Menu Music").GetComponent<AudioSource> ();
MenuMusic.Stop();
}
Follow this Question
Related Questions
play audio for few seconds on key hit 1 Answer
Distribute terrain in zones 3 Answers
Audio listener to mono then to left or right speaker? 2 Answers
Trigger audio loop on beat with PlayScheduled 1 Answer
Forward and Backward 3D sound? 1 Answer