# DistanceToNearestSurface doesnt work runtime \[updated\]

**URL:** <https://forums.unrealengine.com/t/distancetonearestsurface-doesnt-work-runtime-updated/2819246>\
**Category:** Issues and Bug Reporting (Unreal Engine)\
**Tags:** unreal-engine, bug-report\
**Created:** [September 18, 2026, 6:56pm UTC](https://forums.unrealengine.com/t/distancetonearestsurface-doesnt-work-runtime-updated/2819246 "2026-09-18T18:56:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArbyKay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ArbyKay](https://forums.unrealengine.com/u/ArbyKay)\
**Post date:** [September 18, 2026, 6:56pm UTC](https://forums.unrealengine.com/t/distancetonearestsurface-doesnt-work-runtime-updated/2819246/1 "2026-09-18T18:56:52Z")

</div>

### Summary

I upgrade my project to 5.8.2 and i checke that everything look like normal, but i notice that the water material i made that check the nearest surface of the level doesnt work properly

### What Type of Bug are you experiencing?

Level Design & Art Tools

### Steps to Reproduce

Create a Material that uses DistanceToNearestSurface

Place the material on a Mesh, could be a flat plane or a cube.

### Expected Result

The material detects the surface is touching of any mesh (B) is near the mesh (A) that has the material and creates the siluette of the mesh is touching

### Observed Result

the editor show the material unaffected by any mesh near the surface even if you play the game on standalone.

it seems like when Realtime is activated the node doesnt work, not even playing in standalone or new viewport.

on the material preview it works fine but not in the editor viewport

### Affects Versions

5.8

### Platform(s)

Windows

### Upload an image

 ![Sin título.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/9/a592e739e8553697bbb291759340b7d088918972.png)

### Additional Notes

generate mesh field distance is on  
the material works on 5.6 before upgrade

---

<div class="post-metadata">

**Author:** ![AlienRenders](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlienRenders](https://forums.unrealengine.com/u/AlienRenders)\
**Post date:** [September 18, 2026, 8:30pm UTC](https://forums.unrealengine.com/t/distancetonearestsurface-doesnt-work-runtime-updated/2819246/2 "2026-09-18T20:30:52Z")

</div>

I have the same problem, but only when I use SSAO. If I use DFAO, it works fine.

Can you specify if you’re using SSAO?

---

<div class="post-metadata">

**Author:** ![ArbyKay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ArbyKay](https://forums.unrealengine.com/u/ArbyKay)\
**Post date:** [September 29, 2026, 9:20pm UTC](https://forums.unrealengine.com/t/distancetonearestsurface-doesnt-work-runtime-updated/2819246/3 "2026-09-29T21:20:42Z")

</div>

No i wasnt using none of that.

---

<div class="post-metadata">

**Author:** ![ArbyKay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ArbyKay](https://forums.unrealengine.com/u/ArbyKay)\
**Post date:** [October 3, 2026, 2:20pm UTC](https://forums.unrealengine.com/t/distancetonearestsurface-doesnt-work-runtime-updated/2819246/4 "2026-10-03T14:20:45Z")

</div>

![Sin título](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/0/77006b77e6e8d585e38339d8cb124a171569ecc5.jpeg)

the issue still persist on 5.8.3, i have the copy the exact same project 5.6.1 to 5.8.3

the runtime its broken on viewport and standalone but not on the material runtime

 ![Sin título](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/8/f/68fa4da859ab2a03bcefb055dd0c6643a34cb47b.png)

 ![Sin título](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/0/a00c82bc5c354e51c2e1d6aaa9546c7ce1056fc5.png)
