> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinemation.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Consumables

> Understand consumable controller sequencing, food and medicine animation, visible stages, and drinking items.

## How the controller uses consumables

`SurvivalPackController` keeps food and medicine in **Consumable Prefabs**, separately from regular **Item Prefabs**. At startup, it creates each prefab below the character's mapped weapon bone and hides it. Every entry in this list needs `SurvivalConsumableExample` and `SurvivalConsumableView`.

![Survival Pack Controller showing regular Item Prefabs and the separate eight-entry Consumable Prefabs list](https://mintcdn.com/kinemation/ZGatOp3ICUy8H4tB/survival-pack/unity/images/survival-pack_survival-pack-controller-component.png?fit=max\&auto=format\&n=ZGatOp3ICUy8H4tB\&q=85\&s=c37334f98a502bc6f5ec49c62353e27a)

Food and medicine use the separate Consumable Prefabs list on the character controller.

Number keys **1–8** send a one-based index to `OnUseConsumable`. The controller ignores the request if another action is active, the index is outside the list, or the entry is missing.

1. Stop aim and use on the active regular item, then play its holster animation.
2. Wait for holster to finish and equip the selected consumable.
3. Let `SurvivalConsumableView` play the opening and repeated use animations. `SurvivalConsumableExample` stores the returned duration as `UnEquipDelay`.
4. When that duration ends, holster the consumable.
5. Hide it, reequip the previous regular item, and wait for its draw animation.

Configure the list before entering Play mode. The example resets the view on every equip, so connect item availability and inventory removal in your own gameplay code.

## Food and medicine prefabs

The setup configuration assigns these entries in order. Their prefabs and procedural assets are in `Assets/KINEMATION/SurvivalPack/Prefabs/Consumables`.

| Key | Prefab | Item | Use count |
| - | - | - | - |
| 1 | `W_Bread` | Bread | 4 |
| 2 | `W_Sausage` | Sausage | 4 |
| 3 | `W_EnergyBar` | Energy bar | 1 |
| 4 | `W_Pills` | Pills | 1 |
| 5 | `W_Medkit` | Medkit | 1 |
| 6 | `W_SodaCan` | Soda | 1 |
| 7 | `W_TinCan` | Tinned food | 3 |
| 8 | `W_Meat` | Meat | 1 |

Each pairs `SurvivalConsumableExample` with `SurvivalConsumableView`. `PA_SurvivalPack_<Item>` selects its character idle pose and procedural settings. The view's action pairs select opening, use, and holster animations.

## Animation and repetition

`SurvivalConsumableView` extends `SurvivalItemView`. On equip, it runs the shared draw setup, resets the use counter and visible stage, and schedules the first use after the opening delay.

**Draw** can contain an opening animation, **Use Animation** contains the eating, drinking, or healing motion, and **Holster** puts the item away. Character and item sides play together where both are assigned. Bread's use action is character-only; a tin can's opening can also animate the item lid.

![Survival Consumable View for bread with paired Use Animation, Use Count 4, Opening Fraction 1, Use Delay Multiplier 0.8, and four Consumption Stages](https://mintcdn.com/kinemation/ZGatOp3ICUy8H4tB/survival-pack/unity/images/survival-pack_consumable-view-component.png?fit=max\&auto=format\&n=ZGatOp3ICUy8H4tB\&q=85\&s=1a39e9aee856a1d5f5ec9d53cf0f25ec)

Bread uses four repeated eating actions and four visible mesh stages.

| Setting | What it changes |
| - | - |
| **Use Count** | Number of use animations per equip, with a minimum of one. |
| **Opening Fraction** | Fraction of the draw pair's duration to wait before the first use. Lower it when use should start before opening has fully finished. |
| **Use Delay Multiplier** | Interval between repeated uses, measured as a multiplier of the use pair's duration. Values below one start the next use sooner. |
| **Consumption Stages** | GameObjects shown one at a time as consumption events advance the stage. |

The opening delay is the draw duration multiplied by **Opening Fraction**. With a valid use animation, the returned sequence duration is `opening + useLength * (1 + useDelayMultiplier * (useCount - 1))`, after clamping the count and delay to their valid ranges.

For example, bread uses four repetitions, **Opening Fraction** `1`, and **Use Delay Multiplier** `0.8`. The tin can uses three repetitions and an opening fraction of `0.85`. These are prefab values, not shared defaults.

## Consumption events and visible stages

The character use clips contain a `UseConsumable` event at the consumption moment. The callback follows this path:

`SurvivalPackController.UseConsumable()` → `SurvivalConsumableExample.Consume()` → `SurvivalConsumableView.OnConsume()`.

`OnConsume()` advances the visible stage. Stage zero is shown on equip. Each event hides the previous entry and enables the next one; after the final entry, all stage objects are hidden.

Keep the event on the character animation, because the character controller receives it. Replacing a clip without this event leaves the visible food stage unchanged even though the controller still waits for the sequence duration.

To apply health, hunger, thirst, or inventory changes, extend `SurvivalConsumableExample.Consume()` and keep its base call so visual stages still advance. This callback can run several times during one sequence; choose whether your gameplay effect applies per bite or once per item.

## Water bottle

`Prefabs/Items/W_WaterBottle` is a drinking item that stays in the regular **Item Prefabs** list. It uses `GameplayItemExample` and the base `SurvivalItemView`, rather than the timed consumable sequence above.

Its action pairs are:

| Action | Character animation | Item animation |
| - | - | - |
| Draw and open | `A_FP_WaterBottle_Draw_and_Open` | `A_W_WaterBottle_Draw_and_Open` |
| Sip | `A_FP_WaterBottle_Sip` | `A_W_WaterBottle_Sip` |
| Holster | `A_FP_WaterBottle_Holster` | `A_W_WaterBottle_Holster` |

Left-mouse use plays a sip and starts an action timer for its duration. `PA_SurvivalPack_WaterBottle` controls the holding pose. Connect thirst or bottle-content changes in your own gameplay logic.

The [pot](https://docs.kinemation.xyz/survival-pack/unity/general/items/tools.md#pot) also has a drinking action, but remains a tool with a lid-toggle secondary action.

## Add or adapt a consumable

Duplicate a food or medicine prefab into your own folder. Keep `SurvivalConsumableExample`, its view, and the paired animation references. Assign a procedural pose, opening and use clips, repetition settings, and any visible stage meshes.

Add the prefab to **Consumable Prefabs**, preserve `UseConsumable` in the character use animation, and test the complete sequence. Check opening, every repeated use, stage changes, holster, and the return to the previous regular item.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.