How to simulate buoyancy on a skinned mesh ocean

I was following a unity tutorial on simulating ocean using gerstner waves, then after i finished i tried researching for buoyancy.

My Ocean:

So i watched dabidar’s video and in the video he said he uses ApplyImpulseAtPosition() to simulate the buoyancy of a boat.

Dabidar’s video on realistic oceans:

Realistic Ocean

how would i achieve that?

1 Like

I have this answer from a similar question, it might be helpful to you as well

Your ocean is noticeably more wavy, so the calculations for the volume of water displaced would have to accept a non constant water level. Handling objects moving sideways from the difference in pressure from one side to the other would probably be very hard to code… (Taking the approach of using many points, you might be able to apply the force in the direction of the ocean’s normal vector, instead of strait up, though I don’t know if that is physically accurate. It would be simpler)

If you just have a boat, I would probably ditch the more physically accurate approach, and just get the height of the water at (3?) points, and use those points to CFrame the ship. The ship would not be able to move up or down the plane of the water
If you query 3 points at appropriate position relative to the ship, you can get 3 vectors, the LookVector, UpVector, and RightVector, allowing you to create a CFrame from that. If you need help with CFrames, I can explain it

sorry how could i do that char limitzzzz

I Already found out how, following archimedes principle still

thats a great explanation😭 so imma put it as a solution

1 Like

What exactly?


The part floating seems pretty good

i just used archimedes principle and applyimpulse at position at 4 floater points. although my calculation may be not that precise but its enough for me

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.