# How to hide water in objects UE5

**URL:** <https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760>\
**Category:** World Creation\
**Tags:** Water, unreal-engine\
**Created:** [April 25, 2023, 4:20pm UTC](https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760 "2023-04-25T16:20:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kesuex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kesuex](https://forums.unrealengine.com/u/kesuex)\
**Post date:** [April 25, 2023, 4:20pm UTC](https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760/1 "2023-04-25T16:20:21Z")

</div>

In my case, only water is hidden at the edges of the box

 ![box](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/b/2bb8ee37740f41400ccac94527352658aa820094.jpeg)

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [April 25, 2023, 4:26pm UTC](https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760/2 "2023-04-25T16:26:15Z")

</div>

Hi Kesuex,

Take a look at this [community tutorial](https://www.youtube.com/watch?v=mEyU18wwMcM). I think he’s showing one way to accomplish what you’re asking.

Cheers.

---

<div class="post-metadata">

**Author:** ![kesuex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kesuex](https://forums.unrealengine.com/u/kesuex)\
**Post date:** [April 25, 2023, 4:34pm UTC](https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760/3 "2023-04-25T16:34:51Z")

</div>

Hello, thank you, but this method does not quite suit me

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [April 25, 2023, 4:42pm UTC](https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760/4 "2023-04-25T16:42:03Z")

</div>

I recall the another method involving [stencil masking](https://forums.unrealengine.com/t/take-out-water-from-inside-of-the-boat-with-custom-stencil-logic-puzzle/365545), but have never implemented it myself and am unsure if things have changed in UE5.

---

<div class="post-metadata">

**Author:** ![kesuex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kesuex](https://forums.unrealengine.com/u/kesuex)\
**Post date:** [April 25, 2023, 5:55pm UTC](https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760/5 "2023-04-25T17:55:47Z")

</div>

Two methods are described there, as far as I understand, the first one does not fit because there are no necessary parameters in the UE5, and I also use the second method with the DistanceToNearestSurface node, but the result I sent is obtained

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [April 26, 2023, 5:05am UTC](https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760/6 "2023-04-26T05:05:29Z")

</div>

The only real way is a double mesh with depth stencils enabled.

---

<div class="post-metadata">

**Author:** ![kesuex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kesuex](https://forums.unrealengine.com/u/kesuex)\
**Post date:** [April 26, 2023, 12:15pm UTC](https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760/7 "2023-04-26T12:15:41Z")

</div>

Do you have any examples of how to apply this method? I would be very grateful.

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [April 26, 2023, 7:51pm UTC](https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760/8 "2023-04-26T19:51:47Z")

</div>

Tutorials no.

Basically you make 2 meshes, or separate the mesh you have in 2 so that there is 2 meshes.

You make the inside mesh render over the water using the stencil.  
The outside mesh is left alone.

If your inside mesh has edges that go all the way to, well… the edge, you won’t notice artefacts.

If it doesn’t, its likely you’d see water from waves and such cutting into the edge.

I don’t exactly remeber, but I do believe you need to modify the water material to output transparency over the stencil value.

Start out with any Custom Depth stencil tutorial so you understand the basics of the system first.

---

<div class="post-metadata">

**Author:** ![kesuex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kesuex](https://forums.unrealengine.com/u/kesuex)\
**Post date:** [April 27, 2023, 11:34pm UTC](https://forums.unrealengine.com/t/how-to-hide-water-in-objects-ue5/1140760/9 "2023-04-27T23:34:22Z")

</div>

Thanks for the info
