Im kinda new to unity so sorry if this is a simple question. I have looked online on how to do this but i can only find JS versions or older versions to my solution.
I am currently using unity 5.0.1 and i am having problems with getting audio to play when a button is pressed.
I have my button setup like this http://i.gyazo.com/7c3ab8eda29faa0bfca16769574ff4b9.png
so for the onlick i have 2 options, one of them is to change scenes and the other one would be the play audio one, this is where the error is occuring, it only changes scenes but doesnt play sound and i get this error:
MissingComponentException: There is no ‘AudioSource’ attached to the “UI manager” game object, but a script is trying to access it.
You probably need to add a AudioSource to the game object “UI manager”. Or your script needs to check if the component is attached before using it.
“There is no ‘AudioSource’ attached to the “UI manager” game object, but a script is trying to access it.
You probably need to add a AudioSource to the game object “UI manager””
I think you added and Audio.Play in your buttons OnCLick listener. If you have the UIManager as the “Object” then it is trying to play that objects audio file… there isnt one, so add it.