Now Loading...

One Minute Wwise | Setting Switches in Unreal

4,734
How to set a Switch in Unreal and expose it in the Details view as a variable. No commercials, no lengthy introductions! 
* Requires Wwise 2019.2.2 or newer. 

Let's head into Unreal and post an Event, based on a Switch set in the main window. First, open a demo project, install Wwise and in Wwise, make a Switch Container with 3 different materials. Create 3 objects. Now, I want each of these objects to use the same blueprint, so they'll have the same basic properties. But I want to be able to assign individual Switches to each of them, so they produce different sounds when I bump into them. So head into the blueprint. Start off by detecting whether a Collision is above a certain threshold and then post the Event. The Switch on the other hand, only needs to be set one time. So from the Event BeginPlay make a Set Switch and reference itself. Now we could just assign the Switch here, but that would make all the objects have the same Switch, since they are all using the same blueprint. So instead, let's make a variable, set it to public, make it of the type Ak Switch Value (Object Reference) and get that variable once we set the Switch. Okay let's compile and take a look at it. Notice how you've got a cool selector on each object and when you bump into it, each of the objects have their own sound, due to the Switch Container routing the Event call to the correct Sound SFX. That's it!

Resources: 
* Wwise Unreal Integration: https://hubs.ly/H0rFtVb0
* Wwise Unreal Blueprint Functions: https://hubs.ly/H0rFvp30
* From Audio File to in-game Audio in Unreal: https://youtu.be/8kDl8w0TwJ8
* Creating a Switch Container: https://hubs.ly/H0rFtW40
* Connecting Switches with Switch Containers: https://hubs.ly/H0rFtWf0

Where else to find us:
Facebook: https://www.facebook.com/AudiokineticWwise
Twitter: https://twitter.com/audiokinetic
Twitch: https://www.twitch.tv/audiokinetic

To get notified when we go live: 
http://info.audiokinetic.com/join-our-twich-community