Created By: Game Audio Resource Ltd Date: 09/11/2019 Version: 1.00
Wwise UE4: Chapter 03 D – Environment:
Trigger A Wwise Event Via A Box Trigger
In this guide we will set a simple Box Trigger to play a Wwise Event when the player character moves over or into the Box Trigger area in the map.
For this guide we will use the large shrub models we implemented in Chapter 01 to play a rustling sound when the player character moves through a dense shrub area.
– TIP: This is not the most efficient way to implement this kind of multi-use process. It would be more efficient to create a more in-depth global BP process, so that all shrubs when moved through based on density size trigger an associated Wwise Event. Saving a lot of audio implementation time. A programmer could also implement a process via C++ code.
- STEP 01: Wwise Hierarchy
- STEP 02: Unreal Hierarchy
- STEP 03: Unreal Level BP & Map Tagging
Download the associated free written guide:
First we set up the associated Wwise content needed
- Navigate to the Audio tab > Actor-Mixer Hierarchy > Default Work Unit > Environment Wwise Work Unit.
Right Click, then select: New Child > Actor Mixer
Name it: ENV_Shrub
- In the General Settings tab > Output Bus, assign the Environment Audio Bus
- Select the Actor Mixer, then in the General Settings tab > Game-Defined Auxiliary Sends, Tick the Use game-defined auxiliary sends box
- Right Click the Actor Mixer, then select: New Child > Random Container.
Name it: ENV_Shrub_Rustle
- Drag in one-shot bush rustle audio assets into the Random Container.
Place them under the Audio File Importer > Destination Path:
SFX > Environment > New Folder – Shrub.
- Select ENV_Shrub_Rustle Random Container.
In the Positioning tab add the following:
Tick override parent
Under Listener Relative Routing > 3D Spatialization, in the drop-down menu select Position + Orientation.
Set the Speaker / Panning / 3D Spatialization Mix value to 0
Under Attenuation assign the new ENV_Small Attenuation that we set up in Chapter 03
- Next, we need to create a unique Wwise event for this content to trigger.
Right click the ENV_Shrub_Rustle Random Container, then select, New Event > Play.
- In the Events tab, location the new Event.
Rename the Event to: SFX_ENV_Shrub_Rustle.
Right click the Environment Work Unit, then select: New Child > Virtual Folder
Name to the new Folder: ENV_Shrub
Then move the Event into the ENV_Shrub Folder
- Save your Wwise Project updates & generate the Sounds Banks.
- Check the new Shrub content is now included in the SB_Environment Sound Bank.
Next, we implement the associated Unreal hierarchy content needed.
- Navigate to the Content Browser tab > Content > Audio > Wwise Events > Environment Folder
Right click in the Environment folder then select: New Folder
Name it: ENV_Shrub
Open the new Folder
- Open the WwisePicker, then drag the Wwise Event: ENV_Shrub_Rustle into the new folder.
- Open the Event in the folder, then assign it to the Sound Bank: SB_Environment.
- Save the Event updates.
- Then generate the UE4 Sound Banks
- Import the Sound Bank updates via the popup message in the low right of the Unreal screen
Unreal Level BP & Map Tagging
- Open the map we set up in Chapter 01 (or the map you are working with)
- In the modes tab, in the search box, type: Box Trigger
Then drag a box trigger into the map, where you want the sound Event to be triggered
- In the World Outliner tab list > Audio_SFX folder, right click then select: Create Sub Folder
Name it: ENV_Triggers
- Drag the TriggerBox list item into the new Triggers folder.
Then rename the TriggerBox to TRG_Shrub_Rustle_01
- Adjust the scale size in the details tab to match the size of your shrub area
- Save your map updates
Now we will add the required BP nodes to trigger the event.
- Select the TRG_Shrub_Rustle_01 in the World Outliner tab
- In the World map toolbar click on Blueprints > then select: Open Level Blueprint
- Then right click in the BP graph. In the search box type: OnActorBeginOverlap.
Then select the node from the results list.
- Right click the BP graph again then select: Audiokinetic > Actor > Post Event
- In the Post Event > Ak Event, assign the Wwise Event: ENV_Shrub_Rustle.
- In the World Outliner, drag in the TB_Shrub_Rustle_01 list item into the level BP graph.
Then Connect it to the Post Event > Actor in.put
- Then Connect the OnActorBeginOverlap node to the Post Event node
- Mouse right click + hold, then drag a highlighted box around these 3 nodes. Then press C on your keyboard. Creating a comments box.
Name the comment: SFX Trigger Bush Rustle 3D
- Save and compile the BP updates.
- Now Play the map, move the player character through the dense shrub bushes where you have placed the Box Trigger.
You should hear the associated audio assets trigger every time you move into the Box trigger area.
You can now repeat the above process for any dense areas of shrubs the player character may move through.
Hopefully this guide will give you other ideas of different content to implement.