0
0
Unityframework~10 mins

Why sound design enhances immersion in Unity - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to play a sound when the player jumps.

Unity
AudioSource.PlayClipAtPoint([1], transform.position);
Drag options to blanks, or click blank then click option'
AaudioClip
Bplayer
CjumpSound
Dtransform
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a GameObject or transform instead of an AudioClip.
2fill in blank
medium

Complete the code to adjust the volume of the AudioSource component.

Unity
audioSource.[1] = 0.5f;
Drag options to blanks, or click blank then click option'
Aclip
Bvolume
Cpitch
Dmute
Attempts:
3 left
💡 Hint
Common Mistakes
Using pitch instead of volume.
3fill in blank
hard

Fix the error in the code to play a sound only if the AudioSource is not already playing.

Unity
if (!audioSource.[1]) {
    audioSource.Play();
}
Drag options to blanks, or click blank then click option'
AisPlaying
BplayOnAwake
Cclip
Dmute
Attempts:
3 left
💡 Hint
Common Mistakes
Using playOnAwake which is a setting, not a state.
4fill in blank
hard

Fill both blanks to create a dictionary that maps sound names to AudioClip objects, filtering clips longer than 3 seconds.

Unity
var soundDict = new Dictionary<string, AudioClip>() {
    {"[1]", clip1},
    {"[2]", clip2}
};
Drag options to blanks, or click blank then click option'
Ajump
Brun
Cwalk
Didle
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated names that don't match the clips.
5fill in blank
hard

Fill all three blanks to create a LINQ query that selects sound names with clips longer than 2 seconds.

Unity
var longSounds = soundDict.Where(kv => kv.Value.length [1] [2]).Select(kv => kv.[3]).ToList();
Drag options to blanks, or click blank then click option'
A<
B>
CKey
DValue
E2
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' or selecting the Value instead of Key.