---
tags:
    - "Drag"
    - "Hold"
    - "Move"
    - "Collider"
    - "Cursor"
    - "Pick"
    - "Touch"
---

# While Mouse Dragging

[Input](../index.md) / [Cursor](index.md) / **While Mouse Dragging**

## Description

Executed every frame the mouse button is held down after being pressed over the target collider

## Code

```cs
using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("While Mouse Dragging")]
    [Image(typeof(IconMouse), ColorTheme.Type.Blue, typeof(BadgeArrowRight))]

    [Description("Executed every frame the mouse button is held down after being pressed over the target collider")]
    [Category("Input/Cursor/While Mouse Dragging")]

    [Keywords("Drag", "Hold", "Move", "Collider", "Cursor", "Pick", "Touch")]

    [Serializable]
    public class TriggerCoreMouseDrag : TriggerHandleSourceBase<HandleOnMouseDrag>
    {
        // PROPERTIES: ----------------------------------------------------------------------------

        protected override string GetTitle(GameObject source) => $"Dragging {this.SourceName}";

        // OVERRIDE METHODS: ----------------------------------------------------------------------

        protected override void OnTrigger(GameObject target)
        {
            using Args args = Args.Get(this.Component, target);
            this.Run(args);
        }
    }
}
```

