Game Development Reference
In-Depth Information
Figure 11-18. The Drone game object's audio source gizmo in the Scene view
In the Inspector, check Play On Awake and Loop. Set the Min Distance to 2 and the Max Distance to
20 in the 3D Sound Settings section.
For now, disable the background music by unchecking its Audio Source component on the Audio
game object. Save the scene and playtest.
As the player approaches the final zone, you begin to hear the drone's audio. When the player enters
the zone and the enemy drone begins moving, the volume increases as the drone gets closer. Since
the Volume Rolloff property is set to its default of Logarithmic Rolloff, the volume increases at an
accelerating rate the closer the drone gets. The enemy drone is definitely more intimidating with
sound effects.
Right now, the Audio Listener is attached to the Main Camera child object of the Free Look Camera
Rig - Pivot. Remember that you can only have one Audio Listener per scene, so find the Main
Camera in the Hierarchy, then in the Inspector disable the Audio Listener component by unchecking
the box near its name.
Back in the Hierarchy, find the Third Person Character Ragdoll and select it. In the Inspector, select
Add Component ➤ Audio ➤ Audio Listener. Playtest again and you'll find that the sound of the
drone is even better when it approaches because the player character gets much closer to the drone
than the camera does.
Find the Audio game object in the Hierarchy and re-enable the Audio Source for the background
music. Use the Volume setting in the Audio Source components to find the right balance between
the background music and the special effects.
Each and every detail matters and makes the difference between a good game and a great game.
The crackly audio for the laser sparks should emit from the same location as the sparks, not the
laser source above the player. Adding a Doppler effect to the projectiles adds to the impression of
their speed, and a “whoosh” heavy with bass tones lends the pendulums an impression of their
heaviness.
 
Search WWH ::




Custom Search