Any way to disable sync of fog settings?

I'm trying to create a multiplayer game that includes the possibility of the player swimming underwater. To replicate being underwater, the common technique is to add some blue fog. If I do that and one player goes underwater, everyone gets the fog. Is there any way to disable sharing of render settings among all the players on the server? Alternatively, is there an alternate method of replicating the underwater fog effect?

Comments

  • You must be syncing the setting somehow in the first place. PUN does not sync values without you causing it somehow.
    You need to find out where you set the fog, why/how it's synced and then only do it for the local character/cam.
  • I assumed that PhotonView was syncing render settings set on my player character by default. I haven't specified any render settings to be synced. The only things I'm syncing manually are player position, rotation, and animation. I don't even know how to sync render settings. That's kind of the information I'm looking for here.

    This is the code that controls my underwater fog settings. No Photon code is even used
    RenderSettings.fog = true;
    RenderSettings.fogColor = new Color(0, 0.4f, 0.7f, 0.6f);
    RenderSettings.fogDensity = 0.02f;
    RenderSettings.skybox = noSkybox;
    Physics.gravity = new Vector3(0, -0.1F, 0);
    

    Is there a different way of setting render settings for a single character? I'm guessing this is setting it globally for one client and PhotonView is syncing it to all the other clients.
  • Photon don't syc itself.

    If when you set the fog "true" on a player and if all other players got the fog, it's because you sync the fog setting somewhere like tobias said.

    As exemple, a player can play with a light "on" and an another with a light "off" but if you put a photon view on it and sync the "on/off" every player will have the same light stat.
  • A light is different. You can add a PhotonView to a light. You can't add a PhotonView to render settings in Unity. Render settings aren't a game object, they're a global setting. That's why I'm thinking that, since it's a global setting, that Photon is syncing the RenderSettings set per character, since my characters are the things with the PhotonViews on them. My ocean plane, which has the script that sets underwater fog settings doesn't have a PhotonView attached and I'm not changing render settings of any type anywhere else.