#Question: To toggle the blue filter (a gui frame), how do they detect that your camera is inside the

1 messages · Page 1 of 1 (latest)

keen parrot
#

e

jaunty cradle
keen parrot
#

oo

#

if camera.position.y >= waterpart.position.y
remove filter
else
apply filter

?

#

like that?

keen parrot
#

i think that's what u meant

#

yeah no part of the map except for the stuff under water, is going to be on the levels below/inside the water

jaunty cradle
keen parrot
#

will bug if i move the water or sumn

#

leme test this

#

leme put ina sample island real quick and increase the water size, i have an old island i made a while back

#

yeah i think it's gonna be okay, thanks @jaunty cradle

jaunty cradle
#

Sorry had to quickly go do something. But yeah, the camera will always be in water once it's lower than that point (as you already stated that all areas lower than it will be water). Anyways, if you change your mind on having nothing below the water than you can always either use raycasts or some exclusion zones (if the camera is in a certain area then it will not be effected by the filter applying below the Y level)

keen parrot
#

how would the raycast work

#

i raycast from my camera's position to where?

#

@jaunty cradle

#

oh do i just raycast downward and see if it hits water?

jaunty cradle
keen parrot
#

kk

#

hopefully i dont end up having to do that :P

jaunty cradle
#

I would personally raycast upwards, as then the cam is definitly under the water. But I do remember raycasts not being the best at detecting water, so you will have to do some messing around

#

Also, of course don't raycast every frame (even though the performance effect is neglictible), just raycasting under a certain Y level is better

keen parrot
#

Ok

delicate aspen
#

why do you need raycast thats dum

#

no raycast required

jaunty cradle