---
tags:
    - "Cursor"
    - "Mouse"
    - "Touch"
    - "Canvas"
    - "Hover"
    - "Blocked"
---

# Is Pointer over UI

[Input](index.md) / **Is Pointer over UI**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

Returns true if the pointer is currently on top of a user interface element

## Code

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

namespace VisualScript.Runtime
{
    [Get]

    [Title("Is Pointer over UI")]
    [Category("Input/Is Pointer over UI")]

    [Description("Returns true if the pointer is currently on top of a user interface element")]
    [Image(typeof(IconUnityUI), ColorTheme.Type.Blue)]

    [Keywords("Cursor", "Mouse", "Touch", "Canvas", "Hover", "Blocked")]

    [Serializable]
    public class TypeBoolInputPointerOverUI : TypeBool
    {
        public override bool Get(Args args)
        {
            EventSystem eventSystem = EventSystem.current;
            return eventSystem != null && eventSystem.IsPointerOverGameObject();
        }

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

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

```

