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

Mouse Position Y#

Input / Mouse Position Y

  • Can Read

  • Cannot Write

Description#

Returns the vertical position of the Mouse

Code#

using System;
using UnityEngine.InputSystem;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Mouse Position Y")]
    [Category("Input/Mouse Position Y")]

    [Description("Returns the vertical position of the Mouse")]
    [Image(typeof(IconCursor), ColorTheme.Type.Blue, typeof(BadgeY))]

    [Keywords("Cursor", "Screen", "Point", "Vertical")]

    [Serializable]
    public class TypeNumberInputMousePositionY : TypeNumber
    {
        public override double Get(Args args)
        {
            Mouse mouse = Mouse.current;
            return mouse != null ? mouse.position.ReadValue().y : 0d;
        }

        public override string ToString()
        {
            return "Mouse Position Y";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.