I cannot figure out how to get a button to play audio clip when pressed. Here is the following steps someone wrote:
-
Add an audio source GameObject to your scene
-
Assign an audio clip to it
-
Uncheck “Play on Awake”
-
Go to the OnClick() section of the UI Button
-
Click the plus sign to add an item to the list
-
Assign the Audio Source object to the object field
-
Choose AudioSource.Play in the dropdown
There is no AudioSource.Play in the drop down only the words No Function…
Anyone have any idea how to get this working?