> For the complete documentation index, see [llms.txt](https://docs.shadersource.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shadersource.io/assets-and-plugins/ocean-tool-2/how-to-use/boats-buoyancy-and-wakes.md). Agents can also search and read this documentation through its [MCP server](https://docs.shadersource.io/~gitbook/mcp).

# Boats, Buoyancy and Wakes

Anything can float on an Ocean Tool 2 ocean: a boat a player drives, a boat that sails a path on its own, a buoy on its mooring, barrels, logs, weed and rubbish washing about. Everything that floats reads the same waves the ocean draws - the actor keeps an exact CPU copy of its rendered waves - so a boat rides the crest you see, and a server floats boats on the waves its clients see.

Two actors do it all:

| Actor                       | What it is                                                                                                                                                                                                                                                     |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Ocean 2 Vessel**          | A boat: a floating physics hull with an engine, a helm, a chase camera and a wake. A player drives it, or it sails a path on its own. It measures itself from your hull mesh.                                                                                  |
| **Ocean 2 Floating Object** | Anything else that floats: a buoy, a barrel, a log, weed, rubbish. **Simple** (follows the waves, cheap) or **Physics** (a rigid body the water pushes about), drifting with the water or moored, rippling the water as it moves. It fits itself to your mesh. |

Both are built from two components you can also use on your own actors: **Ocean 2 Buoyancy** (floats an actor) and **Ocean 2 Wake Source** (makes its wake).

## The quickest way: the Buoyancy & Wakes page

{% stepper %}
{% step %}

### Open the Buoyancy & Wakes page

Open the editor mode's **Simple** tab and its **Buoyancy & Wakes** page.
{% endstep %}

{% step %}

### Turn on wakes

Turn on **Wakes** if your boats and floating objects should push the water (a new ocean has them off: they cost GPU time while on).
{% endstep %}

{% step %}

### Pick your mesh

Under **Boats and Floating Objects**, pick your static mesh.
{% endstep %}

{% step %}

### Make it

Press **Make a boat** or **Make a floating object**. A Blueprint is made next to your mesh - `BP_<mesh>_Boat` or `BP_<mesh>_Floating` - measured or fitted to the mesh, and one is placed on the water in front of the camera, selected. Save the level to keep it, and press Play or Simulate: it floats.
{% endstep %}
{% endstepper %}

Open the Blueprint to adjust it: every setting is on its **Class Defaults**.

![The Simple tab's Buoyancy & Wakes page](https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2Fh62gbtjaz9Eo9wa7GSNr%2Fbf_wake_page.png?alt=media)

## Guides

* Make a Boat From Your Mesh - the hull, its measurements, handling, driving, the autopilot and its wake.
* Floating Objects - buoys, barrels, logs and debris: simple or physics, drifting or moored, and the example Blueprints.
* Riding Wakes and the Simulated Shore - floating on the shoreline's waves and wash on every shore model, on other boats' wakes and on the simulated shore, and boats pushing the shore's water.
* Buoyancy and Wake Components - floating and waking your own actors with the components.
* Swimming - the Ocean 2 Swimming component: any Character swimming at the surface, diving and holding its breath.

## Example maps

| Map                                                                                                 | What it shows                                                                                                                                                                                                                                                                                                                                       |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Examples/Buoyancy/Maps/L_OceanTool2_Buoyancy`                                                      | Open sea and nothing else: every kind of floating object side by side - simple and physics, drifting and moored - and the two kinds of boat, each labelled: the white launch, the simple kind, sailing its loop on its path, and the orange workboat, the physics kind, on autopilot - the one the playground's boat example drives. Both are 20 m. |
| `Examples/SurfCove/Maps/L_OceanTool2_SurfCove_SimulatedShoreline` (Surf Cove (Simulated Shoreline)) | The simulated shore: weed, rubbish, barrels and logs round the jetty, washing up the beach and back.                                                                                                                                                                                                                                                |
| `Examples/Island/Maps/L_OceanTool2_Island`                                                          | The Authored shoreline: logs in the surf on the southern beach (by the **View 2** and **View 7** cameras), carried in by the breaking waves and up the sand and back by the wash; a boat on its loop, and the PWC, workboat and warship to drive.                                                                                                   |

![The Buoyancy example map: simple, physics and moored floating objects, rubbish and boats on the open sea](https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FjrGEA7JKOjH66wQon2Uy%2Fbf_overview.jpg?alt=media)

![Surf Cove (Simulated Shoreline): weed and rubbish in the shallows by the jetty, in the simulated shore's wash](https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FSP4XBUwzwlwVdmA3LH3g%2Fbf_surfcove.jpg?alt=media)

## The playground

The example maps play with the **Ocean 2 Playground Game Mode** - press Play, or set it as your own level's game mode. Its menu offers:

| Mode             | What it does                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Free Camera**  | Fly over and under the ocean: **W A S D**, **E** and **Q** up and down, **Shift** for speed, the mouse to look, the wheel for speed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Third Person** | Walk the shore, wade into the surf and swim as the template's male mannequin, with its animation and the plugin's own swim, crouch and sprint animations (`Content/Examples/ThirdPerson`): **W A S D**, the mouse, **Space** to jump, **Shift** to sprint, **C** to crouch (**Left Ctrl** held). The camera sits over the right shoulder; the **mouse wheel** zooms it, and all the way in is first person as a first person shooter holds it - the view at its eyes, nothing of it drawn, quick on its feet - and it still wades, swims and splashes (**V** switches straight there). It starts on the beach at a Player Start tagged `Ocean2Shore` (the nearest to the view), or without one on the nearest beach it finds, and wades into the surf - slower the deeper the water, pushed by the surf and the wash, its legs pressing on the water so the simulated shore (its own dimple and particle foam) and the wake ripple round it: the wake itself, drawn taller where it has waded and calming there within a few seconds, and on up the wash over the sand - in water a few centimetres deep its legs press the wake at least **Wash Press** deep (15 cm). Too deep to stand, it swims (Swimming): **Shift** faster, **C** or **Ctrl** to dive, **Space** to come up. Dropping in splashes. A level with no beach has no third person mode. |
| **Boat Example** | The drivable vessels in the level (**1-9**). A level with none has no boat example; **Offer Vessels Not In The Level** on the game mode also offers the example vessels it lacks, launched in front of the camera.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

![The playground's menu in Surf Cove: the free camera, the third person mode, and the boat example greyed with no boats in the level](https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2Fyvk3PWhkvzkedkM4WDAs%2Fpg_menu.jpg?alt=media)

In the free camera and the third person mode the mouse has hands: hold the **left button** on a physics object to carry it - the wheel brings it nearer or sends it further, and let go it flies on, so it can be thrown - and press the **right button** to throw a floating object in where the crosshair meets the water: a barrel, a log, weed or a piece of rubbish at random (the game mode's **Throwables**; the oldest go once there are **Max Thrown**). **Pick Up**, **Let Go** and **Throw In** on the playground controller do the same from Blueprint - a gamepad button, say.

![The third person character on Surf Cove's beach, the camera over its right shoulder](https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FuLZkQwBJWT7169d9hclk%2Fpg_shoulder.jpg?alt=media)

{% hint style="info" %}
**Tab** brings the menu back, **F** the free camera, **T** the third person mode, **H** hides the controls help.
{% endhint %}

## Troubleshooting

| Problem                                                             | What to check                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| It sinks, or floats too high                                        | Its mass against its size: a floating object's **Density** (water is 1000), a boat's **Displacement**. For a boat, **Hull Waterline Height** against where the mesh's pivot is.                                                                                  |
| A buoy or a marker falls over                                       | Turn on **Stay Upright** on it (or set its **Centre Of Mass** low).                                                                                                                                                                                              |
| A boat rolls over                                                   | Lower **Centre Of Mass Height**; check its collision is the hull, not a box round the superstructure.                                                                                                                                                            |
| No wake or ripples                                                  | Turn on **Wakes** on the Buoyancy & Wakes page. The wake area follows the camera by default: a boat outside it makes none until it is in view (or set **Wake area follows** to the boats).                                                                       |
| Floating objects ignore the shore's waves or wash                   | The object's **Drift** must be on, and the ocean's **Waves carry floating things**; it must be near the view (inside the GPU's copy of the drawn water, `r.Ocean2.PhysicsPatch`). On the Simulated shore model, **Float on the simulated shore** must be on too. |
| Hundreds of objects                                                 | Use **Simple**, and turn **Make Ripples** off.                                                                                                                                                                                                                   |
| Small things make no ripples                                        | **Fine wake round the view** must be on (with **Wakes**), and they must be within its 64 m round the camera.                                                                                                                                                     |
| A character climbs onto small floating things, or kicks them flying | Raise their **Stand On Mass**; push them by mass as the example's movement does (**Ocean 2 Example Movement**).                                                                                                                                                  |
| A flat, calm patch of sea round something                           | Without a baked shoreline the ocean captures the ground round it itself, and anything solid there counts as land. What floats (an Ocean 2 Buoyancy or Wake Source on it) is left out; tag anything else that should not count `Ocean2IgnoreWater`.               |
