What would be the easiest way to set up this situation? I have a house wrapped in an audio volume. The exterior volume is set to 0.2 when inside - however, I’d like for and area around the door to be 0.5 only when the door is open.
Is there a way to toggle the exterior volume value within a blueprint (while I’m toggling the dorr open/close?)
Assuming your door open and close is done in its own blueprint that already exists in the level, you could simple create an audio volume variable in that blueprint and assign the audio volume in the level to it. You can do this by making the audio volume variable public and then in the world select the blueprint you want to control it from and there should be a spot to assign the audio volume variable in the details panel.
Then you just have to get the ambient settings. This may be odd as it’s a struct but you can easily break it to get the settings. Then, set the settings to grabbing the exterior volume and adding whatever float you’d like to it. Then you can make an interior settings struct out of it and set the volume to the new settings.
Here is an example of how I did it in the level blueprint. I used a trigger volume instead of a door open and close function but it should work the same.
NOTE: I did this in the level blueprint, so i could just grab the audio volume from the persistent world. However, if your door function in in another blueprint, it must be a blueprint in the persistent world for this to work (like on the door) and you would just assign the audio volume to an exposed audio volume variable in that blueprint.
Now, let’s say I wanted to take it one stop further. I find the sudden volume change a little harsh. Could I insert a timeline to gradually fade the audio in and out? I’ve played around with it, but can’t get something that works.
You should be able to just use a delay node between the set operations. So lower the offset value, then do the first set like you already did, and then you’d call a delay, then do another set or however many more you want with a delay node in between each.