Download

Sound replication

Hi :slight_smile:

I’m trying to replicate Hit sound. So when my Actor takes damage, i want to play SoundCue at location on all clients around. Actor without animations.

Best way to do that? NetMulticast exists, but there should be better way.

Thank you

P.S.
How this things handled in big projects like Fortnite?
When you hit rock or tree and clients around hear it?

Hi, couple of things you could do, depending on your setup

(-) just do it locally without any replication (e. g. you got a bullet that is replicated or locally simulated on server and client and what it hits is replicated, then the hit will most likely happen on server and clients and there is therefore no need to replicate that at all)

when my Actor takes damage, i want to play SoundCue

(-) if you replicate something else at that point (e. g. health via repnotify) then you can play the sound from that

(-) multicast

(-) if you replicate something else at that point (e. g. health via repnotify) then you can play the sound from that

Yeah, i was thinking about this.

But when this Actor became relevant for some client and client will get this Health value, Actor will play sound even nobody hit it.
Seems like multicast best way. That’s sad.

If you are using projectiles then the servers can be set to replicate. This will spawn a proxy of the servers projectile on every client. When the projectile hits something have it play sound, decals, fx etc.