Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

On Mouse Click#

Input / Cursor / On Mouse Click

Description#

Executed when the mouse button is pressed and released over the same target collider

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("On Mouse Click")]
    [Image(typeof(IconMouse), ColorTheme.Type.Blue, typeof(BadgeArrowUp))]

    [Description("Executed when the mouse button is pressed and released over the same target collider")]
    [Category("Input/Cursor/On Mouse Click")]

    [Keywords("Click", "Button", "Up", "Collider", "Cursor", "Pick", "Touch")]

    [Serializable]
    public class TriggerCoreMouseUpAsButton : TriggerHandleSourceBase<HandleOnMouseUpAsButton>
    {
        // PROPERTIES: ----------------------------------------------------------------------------

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

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

        protected override void OnTrigger(GameObject target)
        {
            using Args args = Args.Get(this.Component, target);
            this.Run(args);
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.