This buoyancy system was developed in Unity as part of a group project during my studies. The project centred around a boss-fight focused game, where certain stages required platforms for the player to navigate. I took it upon myself to design and implement a system that simulates objects floating in water, capable of dynamically reacting to external forces such as the player’s movement and interactions.
This system, while compact, taught me a great deal. Developing with physics formulas gave me valuable insight into how mathematical expressions directly influence object behaviour and force simulation. It was a genuinely enjoyable challenge that deepened my understanding of physics-based systems in game development.
Looking ahead, there is still plenty of room to expand on this concept. A potential improvement would be incorporating an object’s surface area into the buoyancy calculation, which would allow for more physically accurate results. I may also revisit and re-implement this system in Godot as a future exercise.

The GIF above demonstrates the system in action. While the simulation can occasionally exhibit some instability, such as uncontrolled bobbing. It performs well in its core objectives: responding accurately to moving physics objects and producing a convincing floating platform effect, which was the primary goal of this system.
Formula
The backbone of this system is the formula shown on the right, which calculates the net buoyancy force applied to the object. Depending on the position of each floater point relative to the waterline, this force either pushes the object upward or downward, allowing the platform to dynamically respond to changes in submersion depth.

Floater points

This buoyancy system uses multiple floater points distributed across the platform to calculate buoyancy forces at various locations. Sampling from a single point reduces accuracy, as it fails to account for the submersion depth of individual corners and edges relative to the waterline.
Variables settings
All variables within the formula are fully exposed and can be tuned to achieve the desired behaviour, ensuring rapid iteration and a high degree of customisability. Additionally, the rigidbody settings of the object have a significant impact on the overall feel and performance of the system, and should be configured accordingly.

