How to play a 2D Sound without actors other than the owner hearing it

How do you play a 2D Sound without actors other than the owner hearing it? I have some UI sounds for my player pawn that should should only be heard by that player and none of the other players, and the AI players use a instanced version of that pawn, so whenever the actor has low health you can hear the UI sound that only that actor should be able to hear

The easiest way is probably to condition the triggering of the sound with “is player controlled” (or a test on the player controller, if multiplayer).

I still cant get this to work, Is there a function or variable that can play the event/timeline to only the owning player controller?

Im currently just placing 3D Sounds with low attenuation ranges so only if your right where the camera is you can hear it

Have you considered only triggering the event on the machine that it’s supposed to play on? Presumably your game already makes a distinction between the “current player’s actions” and “the actions of other players,” so having UI sounds triggered by the former and not the latter should be relatively simple.

Would playing the sounds on the specific players instance of the game work?

Yes.

The FMOD Engine has no concept of other instances of itself - and in a multiplayer game, each machine involved in the game is running a different instance of the game, and thus a different instance of the FMOD Engine. Those game instances might communicate with each other, but the different instances of the FMOD Engine do not, and so can be commanded to play different sets of events if you choose.

if simulating in editor via PIE, will FMOD run two instances or will it share the same instance?

Playing in editor creates and runs a single instance of the game, which plays in the editor. This instance of the game creates and runs a single instance of the FMOD Engine.

If your game’s multiplayer works by connecting to other copies of the game over a network, then each running copy of the game it connects to is a different instance of the game, with its own instance of the FMOD Engine.

On the other hand, if your game uses local splitscreen multiplayer, then there is only one instance of the game and one instance of the FMOD Engine. In this case, the concept of playing a sound only through one player’s Ui is meaningless, because all players are using the same screen and speakers.

1 Like