x


underwater effect

How do I get a underwater effect? I can create water but just nothing happens underneath it ...

more ▼

asked Nov 29 '10 at 06:12 AM

garrett gravatar image

garrett
28 2 4 4

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

2 answers: sort voted first

Well because the water is a plane - its means its just a 2D object. So what a lot of games designers do - including me, is have a camera effects as soon so your character goes under the water. Of course that effects will be blurred vision and trickles (of some sort).

So basically you want something that says: If character goes below -20 - then character is in water:

static var InWater == false;

if(transform.position.y < -20)
{
InWater = true;
}

Then with that variable being true you can activate the camera effects with it.

more ▼

answered Nov 29 '10 at 02:21 PM

oliver-jones gravatar image

oliver-jones
2.5k 206 226 254

What happens when you have an area under -20, but with no water? I tried this my self. Really bad idea but its a good start :/

Jan 24 '11 at 04:55 AM Zu01

Well in that case - for ease, you could place a collider box where your water is - and do an OnTriggerEnter = InWater (but have the collider a trigger - and stretch it further than your actual water)

Jan 24 '11 at 04:39 PM oliver-jones
(comments are locked)
10|3000 characters needed characters left

I am not an expert, but try checking the demo project called "Tropical paradise". In this application, you get some sort of faded effect when diving underwater, so maybe it can help you.

more ▼

answered Nov 29 '10 at 10:50 AM

Silvia gravatar image

Silvia
40 5 5 9

(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:

x300
x201
x47

asked: Nov 29 '10 at 06:12 AM

Seen: 2751 times

Last Updated: Nov 29 '10 at 06:12 AM