I am working on a realistic boat system, but I couldn’t figure out how to calculate buoyancy forces.
Here is a test boat:
I put attachments on highlighted areas and every attachment has a VectorForce.
Here is my current code:
game:GetService("RunService").RenderStepped:Connect(function(DeltaTime)
for _,v in pairs(Object:GetChildren()) do
local TopWater = module:GenerateGerstner(v.Position, 0.11, 0.022, module.Time).Y
if v.Position.Y < TopWater then
v.VectorForce.Force = buoyancyForce
else
v.VectorForce.Force = Vector3.new(0,0,0)
end
end
end)
The problem I’m having is I don’t know how to calculate buoyancyForce.