Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
WaterBox is an open-source addon for Godot 4.x that adds buoyancy and drag simulation for RigidBody3D objects inside a water volume.
godot-waterbox
WaterBox is an open-source addon for Godot 4.x that adds buoyancy and drag simulation for RigidBody3D objects inside a water volume.
This repository is the addon distribution repository. It contains the plugin, runtime scripts, built-in materials, and reusable prefabs required to install WaterBox in another Godot project.
Requirements
- Godot 4.x
- a 3D project using
RigidBody3Dphysics
Compatibility note:
- Tested on Godot
4.0.1 - Expected to work with other Godot 4.x versions, but those versions have not been verified yet.
Quick Start
- Copy
addons/waterboxinto your Godot project. - In Godot, open
Project > Project Settings > Plugins. - Enable
WaterBox. - Add a
Node3Dto your scene and attachres://addons/waterbox/scripts/water_box.gd. - Add a child
Area3Dwith aCollisionShape3Dto define the water volume.
Addon Installation (Your Project)
- Copy the
addons/waterboxdirectory into your Godot project. - In the editor, go to
Project > Project Settings > Pluginsand enableWaterBox. - Add a
Node3Dto your scene and attach this script:res://addons/waterbox/scripts/water_box.gd
WaterBox Configuration
Minimal node setup:
WaterBox (Node3D)with thewater_box.gdscript.- A child
Area3Dnode. - Add a
CollisionShape3DinsideArea3Dto define the water volume.
The WaterBox script automatically:
- detects
RigidBody3Dobjects inside theArea3Dvolume - applies buoyancy force
- applies damping through
water_drag
Available exported parameters:
require_buoyancy_component: requiresBuoyancyComponenton floating objectswater_density: fluid density (affects buoyancy force)water_drag: damping for linear and angular velocity
BuoyancyComponent (More Accurate Floating)
Add BuoyancyComponent as a child of RigidBody3D:
- Attach
res://addons/waterbox/scripts/buoyancy_component.gd. - Add
Marker3Dchildren (buoyancy points), for example at object corners. - Set
use_buoyancy_points = true.
If you do not add this component, WaterBox can still work in fallback mode (single buoyancy force), as long as require_buoyancy_component is disabled.
Included Addon Content
addons/waterbox/scripts/water_box.gdaddons/waterbox/scripts/buoyancy_component.gdaddons/waterbox/prefabs/floating_cube.tscnaddons/waterbox/prefabs/floating_capsule.tscnaddons/waterbox/assets/materials/water.tresaddons/waterbox/assets/materials/metal.tres
Repository Structure
.
|-- addons/
| `-- waterbox/ # addon
|-- docs/ # additional documentation
|-- CHANGELOG.md
|-- LICENSE
`-- README.md
Recommended Repository Layout
- Keep the addon in
addons/waterbox(Godot standard). - Keep reusable addon assets inside
addons/waterbox/assets. - Keep addon documentation under
docs/addon.
Documentation
Available docs in docs/:
docs/addon/installation.md(done)docs/addon/api_reference.md(done)
Changelog
- Project change history:
CHANGELOG.md
License
This project is distributed under the terms described in LICENSE.
WaterBox is an open-source addon for Godot 4.x that adds buoyancy and drag simulation for RigidBody3D objects inside a water volume.
Reviews
Quick Information
WaterBox is an open-source addon for Godot 4.x that adds buoyancy and drag simulation for RigidBody3D objects inside a water volume.