Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Unity PlayOneShoot Audio

public class PlayAudio : MonoBehaviour
{
    public AudioSource audioSource;
    public AudioClip clip;
    public float volume=0.5f;

    void Start()
    {
        audioSource.PlayOneShot(clip, volume);
    }
}Copied!
Source by gamedevbeginner.com #
 
PREVIOUS NEXT
Tagged: #Unity #PlayOneShoot #Audio
ADD COMMENT
Topic
Name
7+3 =