4.26 Water Plugin: How to find the accurate Z-Height of the surface of the water?

I am trying to find a long term solution for accurately positioning pawns on the surface of the water. The buoyancy component isn’t how I want them all to function; I only want loose smaller objects like barrels to be physics driven on the water. I want my larger actors to simply follow the waves of the ocean accurately, and use basic flying movement while respecting the Z-Height of the Ocean’s waves.

In order to do that, I need to find the nearest location of the waves underneath from the WaterMeshActor.

I’ve tried raytracing for the water’s surface to no success, as it stops against the flat water mesh. The only info it gives back is the hit location of the water mesh before it’s visuals deform.

I’ve also tried using the water material to find the wave height to feed to my pawns. This would be the most accurate. But, I know little about how to grab a location from it to update it’s world position.

I tried many resources to no success. I feel that either of these approaches would work for my small project. I just need a little help figuring it out. Thank you for your time!

2 Likes

I’m looking for the same as well!! I’m stuck for weeks now going through the c++ code of the whole plugin and what not. Idk what specific function it has in the code that they use to calculate the Z height at any given time on the given position. The water system is highly advanced but I feel it lacks this one little thing of not exposing a function that retrieves the wave height. I really hope the devs look into this. Its just a matter of exposing the c++ function which determines the height to the blueprints.

hi folks ! Stuck on the same thing. There is a method called GetWaveHeightAtPosition :

Anyone find a solution for that ?