menu
Table of Contents
-
Modules
Now you'll import the audio file you intend to use for the heartbeat and configure it to loop indefinitely. Then you'll associate the heartbeat with the player's health.
-
In the Project Explorer, select the Audio tab and drag the Heartbeat audio file from the
Module 5/Audio files for Module 5
folder into the Actor-Mixer Hierarchy’s Default Work Unit. -
In the Audio File Importer that opens, click Import.
A new Sound SFX object named Heartbeat is created.
The audio file plays a heartbeat that only lasts about 30 seconds. Ultimately, you're going to trigger the heartbeat to play with a single Event that occurs only one time when the player first starts a new level, so you’ll need to loop the file to play indefinitely.
-
In the Project Explorer, expand the Default Work Unit, select the Heartbeat object, and then in the Property Editor, select Sound SFX, and select Enable under Loop.
Notice, Loop Infinite is selected by default.
While the heartbeat will technically play the entire time the player is in the game, it could become really annoying to hear it beat constantly. Remember, the point of the heartbeat is to let the player know their health is waning, so we only want to hear it when the health drops below a certain level. To achieve this, you'll use the value of the PlayerHealth Game Parameter to determine the volume of the Heartbeat Sound SFX object.
-
In the primary editor, select the RTPC tab. Double-click the tab to maximize it and see more of the graph view.
-
Click the [>>] selector in the Y Axis column and click Voice Volume.
If your screen is too small to display the entire list of options, you might need to click a down arrow displayed at the bottom to scroll to the Voice Volume option.
-
Click the [>>] selector in the X Axis column and choose Game Parameters > PlayerHealth.
You now see a graph where the X-axis shows player health and the Y-axis indicates the heartbeat’s voice volume. The diagonal red line is referred to as an RTPC curve, which indicates what volume the heartbeat will play at based on the player’s health. The bottom of the Voice Volume column represents -200 dB, which is inaudible. The PlayerHealth Game Parameter uses a scale where 100 represents full health and 0 represents that the player is defeated.
With this default curve, the volume of the heartbeat will increase as the player's health improves. This isn't the behavior you want, but don't worry, you'll tailor the curve to your needs in the next section.