Add Sound Effect – Unity3D (C#)


Add Sound Effect – Unity3D (C#)

You can add sound effects for all actions inScreen Shot 2015-03-12 at 13.55.12 your project. For example, when your character jumps or collides another object or just click on a button, you can call your sound effect. At first, add an “Audio Source” to your scene. As you see in the picture, you can assign a audio file to it. Import your sound file and assign it. Now, open your character script or wherever you want to call it and write your code:

 

 

Assign your audio source tu public clickAudio and test it. Now your sound effect is played when your character collides with game object named Enemy.

©Coffee Break Codes – Add Sound Effect – Unity3D (C#)


Leave a comment

Your email address will not be published. Required fields are marked *

2 thoughts on “Add Sound Effect – Unity3D (C#)