Skip to content
Development
Skill

/ui

Create and lay out Unity UGUI screens

From plugin
unity-skills
1.9k83 skills4 commands

Claude Code

$ npx -y skills add Besty0728/Unity-Skills --skill ui --agent claude-code

SKILL.md

ui.SKILL.md
name: unity-ui
description: Create and lay out Unity UGUI screens

Unity UI Skills

Unity UGUI and Canvas workflows. This module is separate from UI Toolkit. Parameters come from the schema (`GET /skills/schema?names=<skill>&wire=v2`); execution and dryRun rules: root [SKILL.md](../../SKILL.md). Extended examples: [UI_REFERENCE.md](UI_REFERENCE.md).

When to use

  • Building UGUI screens
  • Adding Canvas elements
  • Arranging UI layout

Rules

  • Prefer `ui_create_batch` when creating two or more UI elements. Its `items` parameter is a JSON string, not a raw array.
  • Most create skills take no `x` or `y`. Create the element, then place it with `ui_set_rect`, `ui_set_anchor` or `ui_layout_children`. `ui_create_batch` is for bulk creation, not precise placement.
  • `ui_create_canvas` defaults to `ScreenSpaceOverlay`. Create the Canvas once, then a panel, then the controls inside the panel.
  • Text creation detects TextMeshPro: `TextMeshProUGUI` when TMP is installed, the legacy `Text` otherwise. The response says which one was created.
  • `ui_create_*` skills and batch items take `parentEntityId`, which outranks `parent`. Unlike a parent name that does not match, it never falls back to the first Canvas.
  • `ui_align_selected`, `ui_distribute_selected` and the selection-based layout act on the UI elements selected in the Hierarchy. Select them first.
  • For world-space gameplay UI, build the Canvas here, then convert it for XR with `xr_setup_ui_canvas` if needed.
  • To delete a UI node, use the [gameobject](../gameobject/SKILL.md) module.

Pitfalls

  • `ui_add_canvas`, `ui_create_label`, `ui_create_checkbox` and `ui_set_color` do not exist. Use `ui_create_canvas`, `ui_create_text`, `ui_create_toggle`, and `component_set_property` on `Image` or `Text` (or the dedicated UI property skills).
  • Do not confuse UGUI (`ui`) with UI Toolkit (`uitoolkit`). UXML, USS and UIDocument belong to `uitoolkit`.

Skills Overview

| Skill | Purpose | |-------|---------| | [`ui_create_canvas`](reference/ui_create_canvas.md) | Create a Canvas | | [`ui_create_panel`](reference/ui_create_panel.md) | Create a panel container | | [`ui_create_button`](reference/ui_create_button.md) | Create a Button | | [`ui_create_text`](reference/ui_create_text.md) | Create a text label | | [`ui_create_image`](reference/ui_create_image.md) | Create an Image | | [`ui_create_inputfield`](reference/ui_create_inputfield.md) | Create an InputField | | [`ui_create_slider`](reference/ui_create_slider.md) | Create a Slider | | [`ui_create_toggle`](reference/ui_create_toggle.md) | Create a Toggle | | [`ui_create_dropdown`](reference/ui_create_dropdown.md) | Create a Dropdown | | [`ui_create_scrollview`](reference/ui_create_scrollview.md) | Create a ScrollRect hierarchy | | [`ui_create_rawimage`](reference/ui_create_rawimage.md) | Create a RawImage | | [`ui_create_scrollbar`](reference/ui_create_scrollbar.md) | Create a Scrollbar | | [`ui_create_batch`](reference/ui_create_batch.md) | Create several UI elements in one call | | [`ui_find_all`](reference/ui_find_all.md) | Find UI elements in the scene (read-only) | | [`ui_set_text`](reference/ui_set_text.md) | Update text content | | [`ui_set_rect`](reference/ui_set_rect.md) | Set RectTransform size, position and offsets | | [`ui_get_rect_transform`](reference/ui_get_rect_transform.md) | Read full RectTransform data | | [`ui_set_rect_transform`](reference/ui_set_rect_transform.md) | Set full RectTransform data | | [`ui_set_rect_transform_batch`](reference/ui_set_rect_transform_batch.md) | Set full RectTransform data for several elements | | [`ui_set_anchor`](reference/ui_set_anchor.md) | Apply an anchor preset | | [`ui_layout_children`](reference/ui_layout_children.md) | Lay out children vertically, horizontally or in a grid | | [`ui_align_selected`](reference/ui_align_selected.md) | Align the selected UI elements | | [`ui_distribute_selected`](reference/ui_distribute_selected.md) | Distribute the selected UI elements | | [`ui_set_image`](reference/ui_set_image.md) | Set Image type, fill and sprite | | [`ui_add_layout_element`](reference/ui_add_layout_element.md) | Add LayoutElement size constraints | | [`ui_add_canvas_group`](reference/ui_add_canvas_group.md) | Add a CanvasGroup | | [`ui_add_mask`](reference/ui_add_mask.md) | Add a Mask or RectMask2D | | [`ui_add_outline`](reference/ui_add_outline.md) | Add an Outline or Shadow effect | | [`ui_configure_selectable`](reference/ui_configure_selectable.md) | Configure transitions, navigation and colours |

Workflow

1. Create a Canvas. 2. Group related controls in panels. 3. Create the controls with `ui_create_batch`. 4. Set anchors and layout groups before hand-placing children.

Example

curl -s "http://localhost:<port>/skill/ui_create_canvas?expectProject=<project>" -d '{"name":"MainMenu"}'
curl -s "http://localhost:<port>/skill/ui_create_panel?expectProject=<project>" -d '{"name":"MenuPanel","parent":"MainMenu","a":0.65}'
curl -s "http://localhost:<port>/skill/ui_set_anchor?expectProject=<project>" -d '{"name":"MenuPanel","preset":"MiddleCenter"}'
curl -s "http://localhost:<port>/skill/ui_layout_children?expectProject=<project>" -d '{"name":"MenuPanel","layoutType":"Vertical","spacing":12}'

Errors

Transport-level codes (COMPILING, RATE_LIMIT and others): [error codes](../../references/protocol-error-codes.md).

| Error | Trigger | Fix | |---|---|---| | `TARGET_NOT_FOUND` | The parent, UI element, RectTransform, text or image component, or sprite asset was not found. | Locate the element with `ui_find_all` or `gameobject_find`; check sprite paths with `asset_find`. | | `SEMANTIC_INVALID` | An unknown anchor preset, layout type or alignment, or a name with path separators. | Use a valid value from the error (for example `MiddleCenter`, `Vertical`, `TopLeft`) and retry. | | `SKILL_ERROR` | A selection-based operation had too few UI elements selected. | Select the required elements in the Hierarchy first. |

Read more
@besty0728
Ships withunity-skills

REST API-based AI-driven Unity Editor Automation Engine Let AI control Unity scenes directly through Skills 🎉 We are now indexed by DeepWiki! Got questions? Check out the AI-generated docs → The current official maintenance baseline is Unity 2022.3+.

Stars on GitHub

Momentum

stars in total
1.9k
Star history of Besty0728/Unity-Skills on GitHub, a chart by star-history.com

Other skills on unity-skills.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about ui.

Which coding agents can use ui?
ui installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.