# ForceHoldStart

{% stepper %}
{% step %}

### Create a script

```csharp
using UnityEngine;
using UnityEngine.InputSystem;
using MeshAnimation;

public class MeshAnimationInteractExample : MonoBehaviour
{
    [Tooltip("Target object with MeshAnimationInteract component.")]
    public MeshAnimationInteract target;

    [Header("Hold Example")]
    [Tooltip("Animation to play while held. Must match the name in MeshAnimation.")]
    public string holdAnimation = "";

    [Tooltip("Animation to play on release. Must match the name in MeshAnimation.")]
    public string releaseAnimation = "";

    private void Update()
    {
        var keyboard = Keyboard.current;

        // Example: ForceHoldStart on H press, ForceRelease on H release
        if (keyboard != null)
        {
            if (keyboard.hKey.wasPressedThisFrame)
            {
                target.hold.holdAnimation = holdAnimation;
                target.hold.releaseAnimation = releaseAnimation;
                target.ForceHoldStart();
            }

            if (keyboard.hKey.wasReleasedThisFrame)
                target.ForceRelease();
        }
    }
}
```

{% endstep %}

{% step %}

### Select the animations you want

<figure><img src="/files/DeCdyFbBXtaF4x4kLB9v" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Done

Now, when you hold down the “H” key, the animation starts
{% endstep %}
{% endstepper %}


---

# Agent Instructions: 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:

```
GET https://tkkoi-developer.gitbook.io/tkkoiassets/mesh-animation/start/interaction/api/forceholdstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
