Separate RenderSettings for each player in a multiplayer game?

Hi all,

I’ve got this underwater effect where when the player jumps in a volume of water the RenderSettings are adjusted to darken the fog and bring in the linear far distance really close to the player to simulate murky deep water. The problem is that this code is triggering the RenderSettings for ALL players in the multi-player game not just the player that triggered the change.

Is there anyway to control the RenderSettings separate for each player in a multi-player game?

The same question goes for ImageEffects as well.

Thanks for any tips! :slight_smile:

Yes and yes. You’ve probably got some things synced through your network view that you don’t understand.

Thanks, it’s good to know that the effect I’m trying to achieve is indeed possible. :slight_smile:

For the image effects I can see how your suggestion is most likely the case since i’m only doing

BlurEffect blurFX = gameObject.GetComponent(“BlurEffect”) as BlurEffect;

which is likely finding the same effect in every player’s scene since it’s not doing any checking to see if this blur effect is owned by anyone. I think I can figure out how to fix that.

However, I’m not sure how to associate something like:
RenderSettings.fogEndDistance = UnderwaterFogDistance;
RenderSettings.fogDensity = UnderwaterFogDensity;
RenderSettings.fogColor = UnderWaterFogColor;

Can those settings be tied to say a unique camera using a method like the one described here, assuming I have a way of ensuring I’m working with the correct camera that is.

Thanks for your help! :slight_smile:

Each player should have their own camera and that camera should be controlled the conditions of the local player. There really is no good reason to sync the players’ cameras.

What it seems I have done is made a critical mistake in my initial GameObject / class design.

By not taking into account the need to hold on to unique instances of things like the Main Camera, I’ve sent my scripts looking for unique elements that unfortunately, don’t have non-unique names or tags.

I’ll go through and unravel these scripts and keep an instance ID (or something else unique) as they are instantiated.

Thanks

No problem. In multiplayer you have the game itself and then representations of it for each client.