Unity3d Audio Issues

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Unity3d Audio Issues

Postby zer0sum on Sun Jun 16, 2013 4:51 am

So I did (in Unity editor):

GameObject -> Create Empty

the I dragged my Avatar.cs (the main player animation MonoBehaviour) onto the gamefile.

Inside Avatar.cs I added:

Code: Select all
public AudioClip audioClipJump;


and

Code: Select all
// this is where the jump animation gets played
audio.PlayOneShot(audioClipJump);


Back in Unity editor, I see the component Audio Clip Jump inside GameObject.Avatar, and I drag and dropped the .wav file onto it.

Then I go into the game, and the jump animation plays, but I have no sound :(

here is a screenshot of the Unity editor: http://i.imgur.com/yAtmxgH.png

and like I said, just the 2 lines in the C# file
zer0sum
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 1
Joined: Sun Jun 16, 2013 4:49 am

Return to Programming Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron