I've been working on a skinned mesh ocean for quite a bit of time and I'm having some bugs. The ocean looks and functions like how I want however I tried to make it so that if any parts were in a folder called Buoyancy, they would look like their floating by sitting at the top of the skinned mesh ocean based on the parts X and Z location. It kind of works but not that well. First of all it's close, but not accurate and idk if I can improve that. Also the further a part is from 0,0 the more inaccurate it tends to be and is also buggy, and any big parts are buggy and I have no clue why. Sorry for the yap, I'm just not at all a good coder and would like some help to just know if I did anything wrong or should add something. Thanks!
Video:
https://youtu.be/Hni86dVk2bI