Saturday, February 2, 2013

How to Play Sound On Unity

Here is what I found

1. Create a new javascript
2. Paste in below code

public var clip : AudioClip; //make sure you assign an actual clip here in the inspector
function Start(){        
    audio.PlayClipAtPoint(clip, Vector3 (5, 1, 2)); 
}
3. Drag your javascript to your object
4. Drag your sound clip into the variable "clip"
5. Just run your game and the sound will be played

1 comment:

  1. Android app

    I am very enjoyed for this blog. I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me
    Android app

    ReplyDelete