> ## 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.

# Item View

> This page explains how Item View plays character and item animations together.

## Overview

**Item View** is the component that plays an equipped item's animations and sounds. In Survival Pack, weapon views inherit from `GameplayItemView` so they can animate the weapon and the character together.

For example, when you reload, the character animation moves the hands while the item animation moves the magazine and bolt. The view starts both from the same call.

The example gameplay component decides when an action is allowed. The view plays the corresponding animation and effects. This lets you keep the weapon animation setup when you replace the example controller with your own gameplay code.

## Component setup

Place the view on the item prefab's root alongside its `Animator`. The character example creates the item under the character's mapped weapon bone.

* **Procedural Asset** defines the character's idle pose and procedural features for this item. Equipping the item passes it to the character's animation controller.
* **Item Idle Clip** is the item's own resting animation. A looping clip plays continuously; a non-looping clip is held as a static pose.

The item Animator animates the weapon hierarchy. `GameplayAnimationController` animates the character hierarchy. Keep character and weapon clips assigned to the corresponding side of each action.

## Paired animations

`GameplayCharacterItemClip` stores these three references:

| Field | What to assign |
| - | - |
| **Character** | A `GameplayAnimationAsset` for the character's hands or body. |
| **Item** | A `GameplayAnimationAsset` for the weapon or item hierarchy. |
| **Sound** | An optional Audio Clip played when the action begins. |

`PlayCharacterItemAnimation(clip)` plays the character asset through the character controller, plays the item asset on the item Animator, and plays the sound through the player's Audio Source. Pass `true` as the second argument when the caller handles sound separately.

`clip.GetLength()` returns the longer duration of the character and item assets. Draw, holster, reload, and inspect methods use this duration so gameplay can wait until the action finishes.

You can also play an item-only action:

```csharp wrap theme={null}
public virtual bool PlayItemAnimation(
    GameplayAnimationAsset newAnimation, float startTime = 0f);
```

This returns `false` when the item graph is not initialized or the asset has no clip.

## Equip and unequip

`OnEquipItem(player)` finds the character animation controller, camera, and Audio Source. It then applies the item's procedural asset and the item scale stored in the character's retargeting override.

Always run equip initialization before using a view. Pass the player GameObject explicitly when the item belongs to a character under another parent object.

The base `GameplayItemView` does not contain draw or holster clips. `WeaponView` and `ThrowableItemView` add those actions. Weapon equip also takes the fire rate and fire mode needed to initialize recoil; see [Weapons](https://docs.kinemation.xyz/survival-pack/unity/general/items/weapons.md).

## Item actions

| Method | When gameplay calls it |
| - | - |
| `OnEquipItem(player)` | When the item becomes active. Returns the equip duration. |
| `OnUnEquipItem()` | Before switching away from the item. Returns the holster duration. |
| `OnUseItem()` | When the item is used. Weapon views play firing effects; throwable views start the throw. |
| `OnStopUsingItem()` | When use ends. This stops repeated use or finishes a held action. |
| `OnAim(isAiming)` | When the aim button changes state. Weapon views update FOV, recoil aim state, animation, and audio. |
| `OnInspect()` | When an inspect action is requested. Returns its duration. |

These methods are virtual. The base class leaves use, stop-use, aim, and inspect behavior empty for derived views to implement.

### How the example calls the view

`GameplayItemExample` caches the view in `Awake`. Its `EquipItem`, `UnEquipItem`, `UseItem`, `StopUsingItem`, `Aim`, and `InspectItem` methods forward calls to that view.

The character controller calls the example component after reading input. For firearms, `WeaponExample` adds ammo and firing timers before calling the weapon view. [Character](https://docs.kinemation.xyz/survival-pack/unity/general/character-runtime.md) explains that sequence.

## Visibility and sound

`SetItemVisibility(bool isVisible, float delay = -1f)` shows or hides the item, immediately or after a positive delay. Draw and holster implementations use it to reveal the item after drawing starts and hide it when holstering ends.

`HideBoneByName(string boneName)` forces a bone to a very small scale in LateUpdate. Use it for parts that must disappear during an animation, such as a magazine. `UnhideBoneByName` removes that forced hiding; the animation must write the visible scale again.

`PlaySound(AudioClip clip, float pitch = 1f, float volume = 1f)` plays a one-shot sound through the Audio Source found during equip. Use animation events when a sound needs to happen partway through an action.

## Use Item View with your controller

Keep the view and animation references on your item prefab. Your controller should initialize the view when equipping, call its action methods when input or gameplay changes, and wait for returned durations where actions must not overlap.

If you replace `WeaponExample`, also implement ammo access and firing timing. Calling `WeaponView.OnUseItem` plays a shot's effects; it does not create a projectile or apply damage.

For the included item prefabs and their specific components, see [Weapons](https://docs.kinemation.xyz/survival-pack/unity/general/items/weapons.md).

## Survival item views

`SurvivalItemView` adds draw, holster, use, and aim pairs to the base view. Tools and consumables derive from it. `SurvivalBowView` and `SurvivalRifleView` instead extend `WeaponView` with their weapon-specific sequences.

Keep character events such as `LaunchProjectile` and `UseConsumable` on the character animation, and item effects such as `PlayLighterSparks` on the item animation. [Items](https://docs.kinemation.xyz/survival-pack/unity/general/items/index) links to the weapon, tool, and consumable component setups.


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