Complete the code to play a sound effect using AudioSource.
AudioSource audio = GetComponent<AudioSource>();
audio.[1]();The Play() method starts playing the audio clip attached to the AudioSource.
Complete the code to assign an AudioClip to the AudioSource before playing.
AudioSource audio = GetComponent<AudioSource>();
audio.clip = [1];
audio.Play();You assign the AudioClip variable (e.g., soundEffect) to the clip property before playing.
Fix the error in the code to play a one-shot sound effect.
AudioSource audio = GetComponent<AudioSource>();
audio.[1](soundEffect);PlayOneShot() plays a clip once without interrupting the current clip.
Fill both blanks to check if the AudioSource is playing before starting a new sound.
AudioSource audio = GetComponent<AudioSource>(); if (!audio.[1]) { audio.[2](); }
isPlaying checks if the sound is playing; Play() starts the sound if not playing.
Fill all three blanks to play a sound at a specific position in the world.
AudioSource.PlayClipAtPoint([1], [2], [3]);
PlayClipAtPoint needs the clip, position, and volume (float) to play the sound in the world.