Hi all. I’ve released a free buoyancy plugin and would love some feedback.
The problem. Most buoyancy code applies the buoyant force to the body’s own mass. For anything much less dense than water, that has no limit: an air bubble released under water accelerates at 815g in its first frame and jumps 2 m in a single physics step. Real bubbles start at about 2g, because the water around them has to move too (the “added mass” of hydrodynamics). In the GIF, the usual method is on the left and the plugin is on the right.
The fix. Bounded Buoyancy adds that water’s mass to each body’s inertia every physics step, so nothing falls faster than g and light objects rise no faster than about 2g.
What’s in it:
- Any shape (box, sphere, cylinder, capsule, convex or a mesh) tilts and rights itself; a low centre of mass works as ballast
- Water nodes with waves and currents, placed anywhere in a scene
- Wind with gusts, sails, and helium and hot-air balloons
- Splashes and ripples, with water_entered / water_exited signals for sounds
- A full 2D version for RigidBody2D
- An optional native kernel (Windows and Linux): 300 bodies on waves in about 3 ms a frame
- Works with Godot Physics and Jolt, with a test suite that reproduces the benchmarks
Getting started: enable the plugin, add a BoundedBuoyancyBody (it’s a RigidBody3D) with collision shapes, set its Density (water is 1000), and add a BoundedBuoyancyWater node. To see all nine demo scenes, open addons/bounded_buoyancy/demo/demo.tscn and press F6.
It’s MIT licensed and waiting for review on the Asset Store. In the meantime it’s on GitHub, with a Unity version in the same repo:
If anything floats wrong in your game, please tell me.
