Question about camera, fog and water!

Hi i was wondering how i would go about solving this problem. In my game, when the player goes into water and goes under the water level variable, the fog turns blue. But when my player floats to the top of the water, the fog changes to white since he is out of water. But since there are waves, the water sometimes goes over my player and i see all of the underwater with a white fog.

Is there a way to have two fogs at the same time? Like if you are above water but can periodically see underwater at the same time?

In script that changes fog color, there’s a check for water level. It seems like you’re using a constant for this, which obviously doesn’t matches dynamic water nature. So you just change this constant with a function that checks true water level in that specific point. If your water surface is defined by function, you can use just the same function for the check.

when you use UNITYS advanced water, the position of the water doesnt change, the water just moves with waves so how do i go about coding that. I understand what you mean but if the water is technically still at a fixed point, i dont know how to code the position of it when there are waves since its a fixed position.

He is talking that water level changes for player when waves are coming like top of the wave water level is higher and that would not solve your problem.
In his explanation you would see whole screen blue and if i understand right you want to see top part (out of water) with white fog and bottom part blue? right?
i dont know answer but maybe someone who knows understands better i hope :stuck_out_tongue: