uloop-simulate-mouse-ui

Simulate mouse pointer events on Unity PlayMode UI elements for testing.

500|44|Updated Jun 15, 2025
One-click install
npx skills add https://github.com/hatayama/unity-cli-loop --skill uloop-simulate-mouse-ui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: uloop-simulate-mouse-ui
Source: https://github.com/hatayama/unity-cli-loop/tree/main/.agents/skills/uloop-simulate-mouse-ui
Command: npx skills add https://github.com/hatayama/unity-cli-loop --skill uloop-simulate-mouse-ui

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Simulate precise mouse interactions on Unity PlayMode UI to automate testing and reproduce user pointer events without manual input, enabling deterministic verification of UI behavior.

Core Features & Use Cases

  • Click & Long-Press: Trigger PointerDown/PointerUp/PointerClick or sustained pointer-down for UI elements that respond to pointer events.
  • One-shot & Split Drags: Perform Drag, DragStart, DragMove, and DragEnd with configurable speed and positions for visual inspection and interaction testing.
  • Coordinate-accurate Targeting: Use screen-pixel coordinates (origin top-left) from AnnotatedElements to target frontmost or underlying UI elements reliably.
  • Use Case: Automated PlayMode testing that needs to interact with buttons, sliders, draggable lists, or hold-to-activate controls and verify resulting behavior via screenshots or logs.

Quick Start

Run uloop simulate-mouse-ui with the desired action and screen coordinates while Unity is in PlayMode to click, drag, or long-press a UI element.

Frequently Asked Questions about uloop-simulate-mouse-ui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I simulate mouse interactions on Unity PlayMode UI elements for testing?

To simulate mouse interactions on Unity PlayMode UI, trigger EventSystem pointer events like PointerDown, PointerUp, and PointerClick using screen-pixel coordinates. This enables deterministic automation and verification of UI behavior without manual input.

What do I need to set up before automating Unity PlayMode UI mouse simulations?

Unity PlayMode UI mouse simulations require an active PlayMode state, an EventSystem, and a GraphicRaycaster-enabled Canvas. You must also provide top-left-origin screen pixel coordinates to accurately target frontmost or underlying UI elements.

Can I perform drag operations with configurable speed and duration in Unity PlayMode?

Yes, you can perform one-shot or split drags in Unity PlayMode by configuring drag speed, duration, and screen positions. This triggers DragStart, DragMove, and DragEnd events to test draggable lists or sliders visually and interactively.

How does coordinate targeting work for Unity PlayMode UI testing?

Coordinate targeting for Unity PlayMode UI testing uses top-left-origin screen pixel coordinates extracted from AnnotatedElements. This ensures reliable interaction with the correct frontmost or underlying Canvas-based UI elements during automated test execution.

What types of UI interactions can I automate in Unity PlayMode besides basic clicks?

Besides basic clicks, Unity PlayMode UI automation supports long-press inspections via sustained PointerDown events and split drags with configurable speed. These interactions help verify buttons, sliders, and hold-to-activate controls.

Why are my Unity PlayMode UI mouse simulations not triggering EventSystem pointer events?

Unity PlayMode UI mouse simulations fail to trigger EventSystem pointer events if Unity is not in PlayMode, or if the Canvas lacks a GraphicRaycaster. Ensure an active EventSystem and valid top-left-origin screen pixel coordinates are provided.