> For the complete documentation index, see [llms.txt](https://sunfish-studios.gitbook.io/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sunfish-studios.gitbook.io/main/vehicle/secondary-components/water-effects.md).

# Water Effects

A visual effects controller that drives dynamic water ripple shaders based on bobber interaction. It animates shader parameters to simulate realistic water disturbances when the bobber enters or exits the water surface.

{% hint style="warning" %}
This component was created and designed to be used with **MWaterFish** custom shader that comes with the package, if you're implmenting your on water solution you don't need to use this
{% endhint %}

> ✅ **Requires**: A custom water shader that uses the above properties to render ripple/fade effects.\
> 🎯 **Designed for**: Integration with fishing gameplay events (e.g., animation events or state machine triggers).

***

#### 🔧 Inspector Settings

<figure><img src="/files/rD6wcHlMxP0AiIjWxNVI" alt="" width="366"><figcaption></figcaption></figure>

**Bobber Reference**

* **Bobber**\
  A Global Var `TransformReference` that pointing to the fishing bobber. Used to set the ripple origin in the shader.

**Shader Properties Animation Settings**

* **Enter Water Duration**\
  Time (in seconds) over which the ripple *expands* when the bobber first touches the water. Uses an **ease-out exponential** curve for smooth deceleration.
* **Exit Water Duration**\
  Time (in seconds) over which the ripple *collapses* (via inner hole expansion) when the bobber leaves the water.

***

#### 💡 How It Works

* On **`BobberTouchedWater()`**:
  * Sets the ripple origin to the bobber’s current position.
  * Animates `_FalloffRange` from `0` → original value, creating an expanding ripple.
* On **`BobberExitWater()`**:
  * Animates `_InnerHole` from its original value → `1`, simulating the ripple fading inward until it disappears.
* Uses a **material instance** to avoid modifying the original shader asset.
* Automatically cleans up the material on destruction.

***

#### 🎯 Integration Tips

* Call `BobberTouchedWater()` the moment the bobber hits the water surface (e.g., from a fishing rod animation event).
* Call `BobberExitWater()` when the player starts reeling or the fish escapes.

<figure><img src="/files/dRFbn3cg9sSucywAimzY" alt="" width="374"><figcaption></figcaption></figure>

The [**Event Listener** ](/main/vehicle/secondary-components/event-system.md)is used to respond to events and trigger the responses on **WaterEffects**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sunfish-studios.gitbook.io/main/vehicle/secondary-components/water-effects.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
