Search Unity

Rising water level

Discussion in 'Editor & General Support' started by pixelthis, Aug 4, 2010.

  1. pixelthis

    pixelthis

    Joined:
    Nov 5, 2008
    Posts:
    120
    I am wondering how to go about making a water level rise and fall in something like a bowl. A cylinder (e.g. a cup) would be easy as I could simply move a plane up and down, but a bowl is rounded so as the plane moves it changes in size.

    Is there some way to use a larger plane and mask it to the size of the bowl?

    What info do I need to look at to get me headed in the right direction?
     
  2. Peter G

    Peter G

    Joined:
    Nov 21, 2009
    Posts:
    610
    There is a depth mask shader here that you could use to cover the water. Or, if you can figure out an equation that lines up with your bowls shape, you can use transform.localScale and change it.