AI Footstep Audio (NEED HELP!)

Well it seems I’ve hit a brick wall with figuring out how to create footstep audio for my enemy AI. No matter where I go I can’t seem to find a tutorial or any solutions.

I tried to recreate what I did for my playable character, which did produce foot step sounds for me, but at my characters location and not where the AI was wandering.

Which if I had to guess the reason that happened would be because of these two nodes. I just can’t seem to wrap my head around what else I would place in their spots to take ‘Footstep Sound’ and attach it to ‘Enemy AI’.

I appreciate any and all help! Thank you!

Hi, you are right with your guess and it definitely makes sense that footsteps are being player from player location, as you pass there player location (nodes that you marked).

How to fix this:
I assume this is part of AI’s animation blueprint so you should be able to TryGetPawnOwner and get it’s location.

Alrighty, I’m about to give it a try, but where would I add the location?

I currently have code copied from Matt Aslpands Dynamic Footstep tut. And the Vector - Vector was only being used for the line trace so it’d understand what it’s walking on to swap the sounds up. That’s not where I’d put my AI’s location is it?

You are missing one line marked by red. From GetActorLocation to LineTraceByChannel "Start: pin.

You need to understand what is going on in this logic:

  1. TryGetPawnOwner gives you reference to the AI.
  2. GetActorLocation gives that AI’s location in world
  3. You do line trace from Start to End, so from AI’s location to 200 units under AI.
  4. If this trace hit’s anything (for example ground) you play sound depending on surface type. What is important you play this sound in HitLocation. So if you were starting your trace from Player’s location, it was finding ground under the player and playing sound there.

Hopefully this is understandable.

I didn’t want to keep that tab opened too long, so I recorded a video to show you what I have now with what you showed me and maybe if you have anymore advice on this.

So I was able to get the sound working, it just now sounds like it’s in my ear when he walks and was wondering if there’s a way to isolate his foot steps to a radius around him?

Sorry to bother!

Hi great that it works well now. To make sound hearable only for some distance you need to use Attenuation Settings. In Play Sound at Location node you can press that white arrow to get more settings and there will be Attenuation. By default it’s empty.

Just create new Attenuation (it’s in Sounds category) and adjust ranges. And then select it in Play Sound at Location node.

More details in the doc: Sound Attenuation in Unreal Engine | Unreal Engine 5.0 Documentation

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.