Snapshot triggering for all clients in online game

Hey there! I’m running into a bit of trouble regarding snapshots…

So my scenario here is that we’ve got a little online game we’re building in Unity that involves players on a small map. This map has a few different areas that call for mix changes according to the player’s actions and the player’s location, such as an open field, and a cove. So for instance in the cove we have a trigger box that calls up the cove snapshot with its own reverb, lopass filters for outside ambience, etc.

The problem I’ve run into is that whenever any one of the players/clients runs into this cove or triggers any sort of snapshot, everyone on the server can hear it. So I might be in the open field, but because someone ran into the cove, now it sounds like I’m in the cove.

My initial understanding/assumption was that because it’s online, each client is running their own instance of the game, and we wouldn’t run into this issue. But alas, here I am writing this forum post.

What am I missing here? Do I need to approach this differently?

Thanks in advance,

Garrett

This statement is really only as true as you make it. For anything that is dependent on each client’s PoV that affects the entire mix, you need to ensure that it is only triggered by the client, and not any other players. For listeners this can be pretty easy, as you might only place a listener component on the client’s GameObject/PoV. However, for something like a snapshot, it may require additional coding to make sure that only the client can trigger snapshots when they enter a location or perform an action. The simplest way to do this is likely to add checks that the player triggering a snapshot is the client, and not any others.