Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity play sound effect

public AudioSource audioSource;
public AudioClip audioClip;
[Range(0, 1)] public float volume;

void Start()
{
	audioSource = GetComponent<AudioSource>();
}

void DoStuff()
{
	audioSource.PlayOneShot(audioClip, volume);
}
 
PREVIOUS NEXT
Tagged: #unity #play #sound #effect
ADD COMMENT
Topic
Name
7+7 =