Panting sounds while sprinting

I want my player character to make panting sounds (which I’ve recorded) while sprinting, and then catch his breath upon stopping. I can’t seem to get it to work. So far all I can get it to do is automatically play both sounds when the shift key is pressed, regardless of whether I’m moving. I also don’t know how to make the initial panting sound stop when the shift key is released.

EDIT: Forgot to mention, my game is in first person.


Basically I would add those sounds to your specific animation, i do this for footsteps, there is also a small tutorial on the forum about this, which uses notifies instead of sounds for triggering sounds depending on the ground material.

Because you need to add distance and speed (for the breath) you might use basic notifies on the animation (no sound).

Once you add a notify (new notify) to your animation it becomes available in the Blueprint editor as an event (Notify event)

Attached image shows sound notifies)

That would be really helpful, but unfortunately I don’t have any animations for my character at the moment, and I forgot to mention that my game is first person. I’ll add those things in.

Well, i think ideally, without using animation notifies, you would create a “Sound Cue” add different sounds and add a random play node, then you load an Audio component on Input Sprint Key, and add a “>” node(attach your player speed variable), and click into the > node add a speed (for instance 25), then when triggered, load the audio component (Play audio node). Inside the audio component you can add the sound cue.

If you look into the example SHOOTER GAME (Launcher content), the player character there has such a sound cue.

How would I load an audio component onto the sprint key? Also the > node doesn’t connect to any play audio nodes because its output is boolean.

Look at the shooter game example. I’m back in about 10 hours.