Custom Floater Setup

1

Set up Rigidbody and Collider

Add a Rigidbody component on the object you wish to float

On the Rigidbody:

  • Add a small amount of drag to it (.1 works well)

  • Disable gravity

Add a Collider component to the object. (Box Collider works just fine)

2

Set up a Floater Point

Add a child object called FP or Floater Point. (Name doesn't matter)

In the Floater Point child object:

  • Add the Floater script

  • Assign the parent Rigidbody to the Rigidbody slot on the Floater script

  • Add a Sphere Collider

    • Set collider to trigger

    • Scale the collider down to be close to your object's mesh.

3

Add more Floater Points

Decide how many Floater Points you want on your object. (1 - 4 is recommended)

Duplicate your Floater Point and spread them out evenly amongst your object. (Keep the y position consistent to prevent lopsidedness)

On all your Floater Points, set the number of floaters to how many floater points you have on the object.

  • (If you have a single floater point, check the Stabilize Rotation option to force the Floater to turn itself upright while in water)

4

Adjust Floater Point Values

From here you can press play on your scene and watch the floater float in the water.

Mess with the values on all the Floater scripts and the position of Floater Points to alter how the object behaves in water.

You most likely will want all the Floater Point script values to be consistent across all Floater Points on your object.

Last updated