Getting Z position given X Y coords with Material Displacement?

Hi there,

I’ve been trying this for the last couple of days with no success. I’ve got a flat plane with a material that is modifying the World Position Offset. Doing a line trace just gives me the Z position of the plane without my material modifying it:

7eec46204fc01dd3610fcec4123339535028c9d8.jpeg

By doing this line trace:

6f7dafbd22e1e12adafa96c750edb4a1c961bf31.jpeg

Basically my end goal is, given an X, Y coordinate, just simply return the Z coordinate. I read a lot of forum posts about trying line traces to achieve this. Also read about the RenderTargetLookup tutorial to get this, although my material (ocean) is all being done with equations and no actual normal maps or color maps.

Does anyone know a good way to get the Z value given an X, Y coordinate of a mesh after a material has modified its position? Thanks so much!

P.S., if it’s easier to do it in C++, that’s what I will be translating this BP into any way, I just figured BP would be easier. Thanks!

Product Version: UE 4.15

Actually, just found this thread:

"What you need to do in this case is replicate the sine waves in your blueprint and synchronize the time variable. You could try using “get real time in seconds” or better use a timeline or deltatime on tick in the eventgraph to increment a global parameter in a material parameter collection. "

I was starting to approach it in this way any way so it looks like it will have to do. Just replicate the equation I do in my materials into Blueprints (or C++). If anyone has a better way or if this has been updated since uhh, 2 years ago, then please do tell. If not, I’m just going to assume this is the best way to get the value :slight_smile: Woo!