How can I get blueprints to target the correct Game Object component?

Hey folks!

I’m practicing the Unreal Engine by sharpening up my skills with the Wwise integration. For those that don’t know, Wwise is an audio plugin/middleware. I’m trying to get physical-material based footsteps to work. I do this by creating Physical Materials in the editor properties, creating them in the content browser, and applying them to materials in the game scene or to their respective textures which accept physical materials. I’m essentially following this tutorial: Audiokinetic Blog (I know the link says “Unity-3d”, but it’s two tutorials, one for Unity and one for Unreal, the latter of which may be slightly out of date).

Anyhow, I’ve got it set up the way it looks in the tutorial, and I have a feeling that this step here is tripping me up: http://i.imgur.com/0S1nMm9.png - the modules “Cast to ThirdPersonCharacter” and “GetAKComponent” seem to be where things are going wrong. I have a suspicion that the “As Third Person Character” node might being attached to the “Attach to Component” node improperly, but the tutorial makes little mention of that, but the profiler also seems to point somewhere else anyhow.

What is supposed to happen is that the Animation event on the mannequin’s run cycle is supposed to fire off two AKEvent notifies which actually play the sound. Meanwhile, this switch code which I linked above (which is set by game object and not globally! so that different characters can have different footstep materials, I suppose) will determine which set of footsteps to play. In the profiler for Wwise, we see this: http://i.imgur.com/Qymwc5e.png (please ignore the “Water” switch at the top - that’s me setting it manually in the transport, not affecting the game)

From top to bottom, the soundbank (which holds my sound files) is requested to load, but it’s already loaded in the engine. It then switches the material on the “ThirdPersonCharacter_C_0” gameobject to “Concrete”, and then an event is triggered from the run animation - the game object is “Play_PlayerFootsteps”, though. In the tutorial image of the profiler (here: http://info.audiokinetic.com/hubfs/Picture19.png) you can see that both the switch AND the event play from the “ThirdPersonCharacter_C_0” object.

In other words, the profiler is pointing toward something in the animation being set up wrong, but I’m just not sure what. :confused: Here’s what’s up in the animation window. Both Notifies are exactly the same - and they do play the footstep on the default switch, but the wrong game object (the “Play_PlayerFootsteps” object, which the tutorial asked me to create) http://imgur.com/m9JarYQ

Hopefully someone can give me some help - I tried to be super thorough with what I’ve noticed is wrong and what should be happening.

Cheers!

If you are posting from an AnimNotify, you should know that the AkComponent (The Wwise Game Object) is attached to the mesh component being animated, which might not be the root component of your ThirdPersonCharacter. You should ensure you call GetAkComponent using the mesh component being animated.

In the sample Wwise Demo Game (available through the Wwise Launcher), there is an example of that. First, the animation containing the notify anymates the HeroFPP mesh (http://i.imgur.com/fVgtkON.png). Then, the FirstPersonCharacter has a “Mesh1P” component that uses that HeroFPP mesh (http://i.imgur.com/LY1JeC0.png). Finally, in the Level Blueprint, we get the AkComponent attached to Mesh1P (http://i.imgur.com/b633hi6.png). The return value of GetAkComponent is the same AkComponent as the one used in the AnimNotify.

You should ensure you do something similar in your game.