Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

0 votes
I am adding sound directly to an animation, in the animation blueprints. I am trying to only use one play function (which is a switch) to play the walking sounds. When I walk through a field to change the sound it does not work on the sound in the animation. Yet I know that it does change; because I have tested having the sound manually triggered through a button press. This attached video shows off my problem. I tried doing it through RTPCs as well, through the sound in the level blueprint, but even then when I walked through the fields it would not change.

 

https://www.youtube.com/watch?v=CBdI2si4nV4&feature=youtu.be

 

I found a way around it where when you walk through the volume, it will load and unload banks but the problem with that there is lag in the game.
in General Discussion by Robert M. (4.6k points)

1 Answer

0 votes

The problem is that you are setting the switch on a different AkComponent than the one in your animation.

With the Wwise integration, any object that makes sound has an AkComponent (much like the basic Unreal audio engine has AudioComponents). An AkComponent can be attached to any actor, or any component. In your case, two AkComponents are created:

  1. The first AkComponent is attached to the Player Pawn's root component. This AkComponent is created in your level blueprint, and it is used when you press 'F', and when you enter your Trigger Volume. This is why the switch "works" when you press 'F'.
  2. The second AkComponent is created in your animation, and it is attached to the Mesh being animated. If you're curious, you can take a look at the AkEvent AnimNotify Blueprint. In the Content Browser, go to Engine/EngineAnimNotifies, and open AnimNotify_AkEvent (make sure the "Show Engine Content" checkbox is checked in the view options). You can see that we attach the AkComponent to the mesh.

On the Wwise side of things, the AkComponent corresponds to a Wwise Game Object. What this means in your case is that you are not setting the switch on the correct Wwise Game Object, and this explains why your Set Switch node does not seem to work.

To fix this issue, you need to set the switch on the mesh. From the Level Blueprint, you can do something similar to this:

To help debug such issues, the Wwise profiler is very useful. In the Capture Log window, you would have seen that the "Set Switch" and the "Post Event" were being made on different game objects.

Hope this helps!

by Benoit S. (Audiokinetic) (16.0k points)
By the way, thanks for the YouTube video, this made the issue very easy to see!
Benoit thank you so much, worked like a charm. Sorry if I ever annoy you XD
Don't worry about it, I'm always glad to help!
...