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

Pointer Position#

Input / Pointer Position

  • Can Read

  • Cannot Write

Description#

Returns current position of the Mouse, Pen or Touch pointer

Code#

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

namespace VisualScript.Runtime
{
    [Get]

    [Title("Pointer Position")]
    [Category("Input/Pointer Position")]

    [Description("Returns current position of the Mouse, Pen or Touch pointer")]
    [Image(typeof(IconCursor), ColorTheme.Type.Blue, typeof(BadgePosition))]

    [Keywords("Cursor", "Mouse", "Touch", "Pen", "Screen", "Point")]

    [Serializable]
    public class TypeVector2InputPointerPosition : TypeVector2
    {
        public override Vector2 Get(Args args)
        {
            Pointer pointer = Pointer.current;
            return pointer != null ? pointer.position.ReadValue() : default;
        }

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

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