Help this asset pack reach its goal

Raised
$0.00
Goal
$10.00
0%
of goal

A downloadable asset pack

Get this asset pack and 1 more for $2.74 USD
View bundle
Buy Now
On Sale!
50% Off
$2.99 $1.49 USD or more

Buoyancy Script for Unity

Bring Your Objects to Life with Realistic Floating Physics!

Create stunning water interactions with this easy-to-use buoyancy script! Perfect for boats, barrels, debris, or anything you want to float and interact with water dynamically. Whether you're building a serene ocean scene or a stormy adventure, this script gives your objects realistic buoyancy with customizable behavior. 🌊

Features

✅ Dynamic Buoyancy: Objects float and respond naturally to water movement.

 âœ… Wave Conformance: Adjusts to water surfaces using Unity's HDRP WaterSurface system. 

 âœ… Customizable Settings: Fine-tune buoyancy strength, damping, and sinking depth. 

 âœ… Easy Setup: Simple to integrate and works with tagged water objects. 

 âœ… Versatile: Works for a wide variety of floating objects, from tiny debris to large ships.

How to Use

Step 1: Attach the Script

  • Drag the Buoyancy script onto any GameObject in Unity.
  • Ensure the GameObject has a Rigidbody component. If not, add one via Component > Physics > Rigidbody.

Step 2: Configure the Rigidbody

  • Enable Use Gravity in the Rigidbody settings.
  • Adjust Mass and Drag values to fit your object's size and behavior.

Step 3: Assign the Water Surface

  • Use Unity's HDRP WaterSurface or any collider tagged as "Water."
  • Drag your water object into the script’s Target Surface field in the Inspector.

Step 4: Fine-Tune Settings

  • Factor: Controls buoyancy force strength.
  • Damper: Smooths out movement to reduce jittering.
  • Sinking: Determines how much the object submerges into the water.

Step 5: Test Your Scene

  • Place your object above the water in the scene.
  • Press Play and watch it float!
  • Adjust settings as needed to achieve the perfect floating effect.

Important: Enable Water Projection

Enable Use Water Projection to make objects conform dynamically to waves and surface normals. This is perfect for creating immersive, wave-driven interactions!  It is required for the buoyancy system to work.

Why You'll Love It

This script is designed for developers who want robust, physics-based water interactions without the hassle. It’s highly customizable, lightweight, and integrates seamlessly into your Unity projects.

Purchase

Get this asset pack and 1 more for $2.74 USD
View bundle
Buy Now
On Sale!
50% Off
$2.99 $1.49 USD or more

In order to download this asset pack you must purchase it at or above the minimum price of $1.49 USD. You will get access to the following files:

Unity-HDRP-WaterBuoyancy-CurrentUpdate.unitypackage 23 kB

Download demo

Download
OceanGameDemo.zip 135 MB

Development log

Leave a comment

Log in with itch.io to leave a comment.