I did this by generating a heightmap from the ocean material which is then sent to a render target. This render target is passed into a little bit of C++ code that read and stores the values every frame.
The floating objects are covered in test points that read height values from the C++ Heightmap reader. From those heights it then applies a force to the mesh at their locations. If they are underwater the object is pushed up, if they are over water gravity pushes down at that point only. This allows the actors to sway and bob with the water.
Everything except the heightmap reader was done with blueprints.
No comments:
Post a Comment