Hi is great so far! While I’m new to UE4, I’ve been a C++ games programmer for 18 years. I realize the tutorial was a quick way to get things out and working, but I never actually got the buoyancy part to work. I really struggled with understanding how to connect the ocean blueprint to talking with the Ocean Manager class and how to hook it up and instantiate it.
But I haven’t done things precisely like the tutorial. I created a lake blueprint where the goal is to completely self-contain everything. As a user, all you do is position a single 3D point in your world, and it’ll automatically calculate the lake for you – by tracing a bunch of rays outwards and colliding with terrain. Right now my test case is a very obvious crater and that works fine. I also attached a post process component to deal with underwater, and use more BP scripting to determine if the camera is below the water plane or not – currently it’s not accurate because I’m not getting the correct heights, but I’m sure that will be easily fixed.
My “lake” blueprint contains a billboard to signify something to click on to select it, a Static Mesh which is contains a Shape_Plane, and a PostProcessComponent to detail the UnderwaterFX. The contruction script sets the water material and disables the post process effect, and uses the ray trace system to determine how the plane shall be positioned and scaled. The Event Graph is responsible for testing the camera against the water plane to set whether the post process fx is enabled or not.
But now my latest attempt is to hook up the Ocean Manager to the Lake BP – and I am failing to figure how the best way to do . The approach I’m currently attempting is to add a “Child Actor” component to the components list and set the Child Actor class to “OceanManager”.
Can anyone recommend a next step for me to pursue?
Also I had to change the OceanManager header from class AOceanManager : public AActor to UOceanManager : public UActorComponent. It compiles but not sure I’m doing correctly.