Replicating sounds not working as expected

I have a problem that I can’t wrap my head around. I’m using FMOD but I don’t think that should be any different from using UEs built in sound events.

So when the jump button is pressed I do a “switch has authority”-check:

  1. The remote(clients) triggers an event that is run on server(2).
  2. The server triggers the sound(play event attached) using multicast.

The problem is that the jump (triggered on the server character) is only heard if he stands next to the client character. The Client hears its jump sounds all of the time. I don’t understand why.

I have tried doing “play event at location” instead but that doesn’t make any difference. All of the sudden I feel like I don’t understand anything about replication…

Does anyone know what is going on?


You should call playing sound from server to all (multicast) or to owning player. But it should be called from server.

But isn’t that what I am doing? Having the clients tell the server to trigger the sound thru a multicast. Maybe I am doing this all wrong, don’t know anymore.

Have you tried using anim notifies on the jump animation? No need to replicate (rpc) anything if you do it that way.

Hi Rev!

Yes, I actually started my quest there. I did the same procedure as in my BP_Character but the result was the same. I made a footstep component that sits on the character and triggers on step notifys and that works fine(although I am starting to suspect that I can hear the steps of characters far away just as well as if they where up close).

I made it a separate component so I could use it on different characters(and trace for different materials), the sound is triggered in the component and not in the animation BP.

A jump sound isn’t really a big deal but I am starting to suspect a large hole in my understanding of networking.

Your client will replicate your opponents and AI’s movement. Thus if you use an animation notify to trigger execution of the sound (spawn sound at location) your client will play movement sounds for the proxy.

Code and execution should be in the character animation bp.

Each of these movement sounds should be using attenuation with an inner radius of 0, and a logarithmic curve.

Event on Landed should be used for landing sounds… fall, end of jump etc.

I’ll post some pics/bp in a bit. heading out for a few.

I see! Will have to try this tomorrow. If you have time to make some pics that would be awesome.

[USER=“1821903”]Bobby Rösehag[/USER]

Here you go.

Setup anim notifies for foot_r and foot_l in each locomotion anim sequence… walk, run, jog etc.

Next, Create a Function (FootStep Sound) in the Animation BP for the character. This function will fire a line trace from the appropriate foot socket toward the ground. This will return the physical material -> Surface type in which we can use a switch to assign the correct sound. Then play the sound at the foot socket location.

** All Set Variables in the function are “Local”.
** Character Ref is set in the anim BP on initialize.

Next, You’ll setup the anim notify events and call the function.

That’s pretty much it.

Here’s my sound struct


For an Actor Component approach …

AC_MovementSound

Same exact Function is used, just coded into the actor component.

Making the call.

edit … forgot to note attenuation.

Create an Attenuation class… Create advanced asset → sounds → sound attenuation.

Tweak the settings as needed.

set the attenuation class in the “play sound at location” node.

BTW, you’d take the same approach to Jump Sounds. Just pop a notify in the jump animation and setup the event notify to play sound at location.

Thanks alot for all the pictures and the effort you put in. I already have a system for footsteps that works but after I moved the sound trigger for the jump into the animation BP and reworked the character reference path, and now it works. I did not use any multicasts of server calls, just a regular “play event at location”. I’m not sure how the blueprint gets replicated but it seems the events get replicated along with the movement?

Great rundown of your workflow, I think others will find it useful to!

So this actually works now I just had to set the character reference on animation update if not valid.
UE4Editor202012051216.png

It’s not that the blueprint is replicated. Your opponents need to move. In order for them to move your client loads their character and animation classes and executes the movements. Anything coded in that logic gets executed. So by running an animation that has an event in sequence said event will execute.

Same logic applies to guns for example. You don’t have to replicate muzzle flash, shot sound etc for each shot. Simply having those functions coded in the firing event sequence will have them execute.


As far as the jump goes, the same logic applies. Anim notifies on all jump start points. Event calls function.

https://i.imgur.com/iXK361k.jpg

Oh and FYI the processing flow (low level) for characters is Character class (event graph) then animation class (event graph), then animation class (anim graph).