Stop footsteps when in water??

Im using the animation for my character to add footsteps (audio cue), in the script in the actor, it checks for collision overlap which i want to make it so it stops the footsteps. how??

As far as I know, the best way to approach this (at least in my experience) would be to NOT use audio cues directly in the character animation - audio cues placed directly in the animation are good if you want them to be forced as JUST audio, but typically you’ll want more manual control of stuff like footsteps (like in your case where you want the footsteps to stop in water.)

Instead, what you can do is add a custom “anim notify” - when you added the audio cue in the animation, I’m assuming you pressed “add sound” - its in the same menu, but at the very top it says “new notify.” You can name this something like “Footstep” or something. Use this for the steps.

From there, you can use that “notify” as an event in an animation blueprint. In the character’s animation blueprint (good to have if you don’t have one already!), you can add an event by the name of “AnimNotify_Footstep” or “AnimNotify_[whatever you called the custom notify]”

This event will call whenever a footstep happens. From this event, you can do literally anything - including playing sounds only if the player is NOT currently overlapping with the water.

This will also be a great long-term investment, too! With full control over the footstep event, you can make it so that there are different footstep sounds for different surfaces among other things.
More manual control is always a win!

Hope this helps! :heart:

What @VillagerFilms said.

Use Anim Notifies on each foot plant in locomotion animation sequences to trigger an event.
Have the event do a trace down from 20cm above the foot that planted.
get bone location (foot_l) add 20cm to Z (trace start), subtract 200cm from start (trace end)

From the Hit result get the physical material → Surface type to determine specific sound. (grass, concrete, wood etc).

You can then run conditional logic prior to setting the sound and playing it. You should have a way to determine if your character is in water. For simple water (shallow, cant swim in) like sheet plane over a creek/ditch. You can add an Actor tag (Water). Then get that tag from the hit result.

Hit Actor -> Actor Tags -> Length > 0 -> Get copy (0) -> == water etc

If you’re in swimmable water your CMC movement mode would be “Swimming” which you can check against.

1 Like

Here’s a few screens from one of my older setups.

I’m doing binaural precise audio which requires a specific foot from the anim sequence.

Character class has Audio Components attached to the Feet sockets.

Trace setup

Defining audio Component to use

Defining Sound, and Playing on set audio component

1 Like