> 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/ui-fish-strike.md).

# UI Fish Strike

<figure><img src="/files/Jmh6PGCnkXqhCWQ0QXYL" alt="" width="563"><figcaption></figcaption></figure>

A UI component that visualizes the player’s remaining reaction time during a fish strike using a dynamic fill bar. The bar fades in when a fish bites and fades out when the window closes, with color shifting based on urgency.

Attach this to a UI element (e.g., a canvas or panel) that should display real-time strike timing feedback.

***

#### 🔧 Inspector Settings

<figure><img src="/files/vnSgj6CZ4eYhV3wW7dps" alt="" width="341"><figcaption></figcaption></figure>

**References**

* **Time Fill Bar**\
  The `Image` component,  a filled horizontal bar that visually represents remaining strike time.

**Time Settings**

* **Remaining Time**\
  A `Global Float Reference` from fishing state that provides the current time left before the fish escapes.

**Fade Settings**

* **Fade In/Out Duration**\
  Duration (in seconds) for the smooth fade-in when the strike begins and fade-out when it ends.

**Color Settings**

* **Time Gradient**\
  A `Gradient` that maps fill percentage to color—e.g., green (plenty of time) → yellow → red (almost out of time).

***

#### 💡 Key Behavior

* **Automatic Monitoring**: When `StartRemainingTimeMonitoring()` is called, it:
  * Records the initial (`max`) time value.
  * Fades the UI in.
  * Continuously updates the fill amount and color every frame via `Update()`.
* **Visual Feedback**: The bar’s color dynamically shifts using the provided gradient, giving players intuitive urgency cues.

***

#### 🎯 Usage Flow

1. Fishing system detects a bite and begins counting down `remainingTime`.
2. Calls `StartRemainingTimeMonitoring()` on this component.
3. UI fades in and displays a live-updating time bar.
4. When time runs out or the player reels in, the system calls `StopRemainingTimeMonitoring()`.
5. UI fades out smoothly and stops consuming update cycles.

<figure><img src="/files/NWtXvxyBFIXLlpLu2g9K" alt=""><figcaption></figcaption></figure>

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


---

# 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/ui-fish-strike.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.
