x


WATER....WATER....I NeeD WATER...help me x.x

Hey In all seriousness I need help to create basic water that's mildly realistic without the pro version. I know that you can somehow do it with the prefabs in Standard assets, but I have no idea how I've been experimenting with it for about four hours and still haven't gotten it. Can someone point me in the right direction? Also if you can help me understand how to make underwater effects like it getting darker under the water and it diffusing the vision just a little.

I am making now two games one a free multiplayer post-apocalyptic rps XD

All help will be greatly appreciated as always, Tracey Pitloun the NEwB of Unity

more ▼

asked Feb 27 '11 at 01:47 AM

Tracey P gravatar image

Tracey P
113 18 18 24

What a thought provoking and insightful Title.

Jun 30 '11 at 11:56 AM biohazard
(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

Ok Ive fixed it with the help of WesleyE. What I did is I set up a box collider underneath the water plane and named it underwater and then applied my code to it which is:

 //set your varibles here.  var fog = false;  var fogColor = Color (0, 0.4, 0.7, 0.6);  var fogDensity = 0.04;  var skybox : Material;  //this is where you go underneath the water or in this case into the trigger aera  //this is just the effect not anything to do with force.  function OnTriggerEnter(other : Collider) {  fog = true;  RenderSettings.fog = fog;  RenderSettings.fogColor = fogColor;  RenderSettings.fogDensity = fogDensity;  RenderSettings.skybox = skybox;  }  //this is where we are exiting the water and the effect of being underneath the water is ended.  function OnTriggerExit(){  fog = false;  RenderSettings.fog = fog;  }
more ▼

answered Feb 27 '11 at 03:19 PM

Tracey P gravatar image

Tracey P
113 18 18 24

(comments are locked)
10|3000 characters needed characters left

Hey never mind it was so simple all I had to do is put it in there lol and I found a previous question that has a script that allows me to make the underwater effect thanks anyway :D

more ▼

answered Feb 27 '11 at 02:15 AM

Tracey P gravatar image

Tracey P
113 18 18 24

Still need help with underwater effect because the script I made isn't working as I want it

Feb 27 '11 at 03:05 AM Tracey P
(comments are locked)
10|3000 characters needed characters left

The script for underwater I am using now is

 var fog = false;
    var fogColor = Color (0, 0.4, 0.7, 0.6);
    var fogDensity = 0.04;
    var skybox : Material;

    function OnTriggerEnter(other : Collider) {
        fog = true;
        RenderSettings.fog = fog;
        RenderSettings.fogColor = fogColor;
        RenderSettings.fogDensity = fogDensity;
        RenderSettings.skybox = skybox;
    }

the problem now is that when I leave the water it keeps the effect on Any Ideas On how to fix this

more ▼

answered Feb 27 '11 at 03:09 AM

Tracey P gravatar image

Tracey P
113 18 18 24

Use the onTriggerLeave function to restore the fog when you exit the trigger area.

Feb 27 '11 at 11:36 AM WesleyE

thanks ill try it out

Feb 27 '11 at 02:28 PM Tracey P

It needed a

function OnTriggerExit()  //then  fog = false;  RenderSetting.fog = fog;
Feb 27 '11 at 03:12 PM Tracey P

somebody tell this guy the freaking difference between comments, answers and edits

Jun 30 '11 at 12:38 PM biohazard
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5275
x3935
x304
x63
x49

asked: Feb 27 '11 at 01:47 AM

Seen: 1767 times

Last Updated: Jun 30 '11 at 12:38 PM