# SetScrollValue

{% 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;

    [Tooltip("Animation to scrub with the scroll wheel. Must match the name in MeshAnimation.")]
    public string scrollAnimation = "";

    private void Update()
    {
        var mouse = Mouse.current;

        // Example: drive scroll animation from mouse wheel
        if (mouse != null)
        {
            float wheel = mouse.scroll.ReadValue().y;
            if (Mathf.Abs(wheel) > 0f)
            {
                // Override the scroll animation name before driving the value
                target.scroll.animation = scrollAnimation;

                float next = Mathf.Clamp01(target.ScrollValue + wheel * Time.deltaTime * 0.1f);
                target.SetScrollValue(next);
            }
        }
    }
}
```

{% endstep %}

{% step %}

### Add “Mesh Animation Interact” to the appropriate field. Also, enter the name of the animation you want to trigger.

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

{% step %}

### Done!

Now, once you hover over the object and start scrolling the mouse wheel, the animation will start!
{% 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/setscrollvalue.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.
