/unity-dev:unity-ui-uguifrom unity-dev
Diagnoses and fixes Unity uGUI issues: invisible elements, broken layout, unclickable buttons, ScrollView glitches, and resolution scaling problems.
Ships in unity-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
uGUI fails silently and looks fine doing it. A zero-height element, a missing EventSystem, a custom
Graphicwith noCanvasRendererand a Layout Group fighting a ContentSizeFitter all produce a hierarchy that inspects correctly and shows nothing. Almost every "it doesn't work" here is one of six checks.
Not sure the project is uGUI? unity-game-ui §0 has the detection ladder.
| Symptom | Go to |
|---|---|
Canvas, uGUI, RectTransform, Layout Group, CanvasRenderer, a UI .prefab — working rules first | §0 |
| "The element is invisible" | §2 visibility checklist |
"My custom Graphic draws nothing" — a Graphic / MaskableGraphic subclass | §2, then reference/code-built-ui.md §2 |
| "The button does nothing when I click it" | §5 interaction readiness |
| The layout collapses to zero height, or children ignore the sizes you set | §3 |
| Content won't scroll, or the list duplicates on every reopen | §3 ScrollView |
| Wrong at another resolution; "the HUD is cut off on a tablet" | reference/canvas-and-text.md §1, then reference/canvas-scaler-and-anchors.md |
| Text vanishes instead of truncating | reference/canvas-and-text.md §4 |
| Text cards overlap once real content arrives | §3, then reference/text-and-image-traps.md §1 |
| "The pressed button turns black" | §5 |
| "The screenshot is one flat colour" | reference/no-mask-lists-and-motion.md §1 |
| Transitions freeze on the pause screen | reference/no-mask-lists-and-motion.md §3 |
| The UI is built from C# with no prefabs | reference/code-built-ui.md |
Ambiguous-type compile errors on Image / Button | §0 |
| Material count grows each rebuild; TMP outlines | reference/text-and-image-traps.md §6 |
| Making it readable at distance, contrast, type size | skill unity-game-ui |
These are not style preferences; each one prevents a specific cascade.
UnityEngine.UI.Image, UnityEngine.UI.Button); bare names collide,
with UnityEngine.UIElements among others. But Canvas and RectTransform are not in
UnityEngine.UI — UnityEngine.UI.Canvas does not exist. Canvas is in UnityEngine
(assembly UnityEngine.UIModule); Image, Button, CanvasScaler, the Layout Groups and
EventSystem are in UnityEngine.UI (assembly UnityEngine.UI).unity-game-ui §0).Edit the hierarchy through a live Editor, not .prefab / .unity YAML — unity-debug →
reference/editor-control.md; the reasons are in unity-cli.
reference/canvas-and-text.md §1Render mode, the scaler's match and reference resolution, and why the HUD is cut off on a tablet.
Order matters. Anchor preset → pivot → position/offsets. Pick corner, edge (stretch one
axis) or fill; set anchorMin / anchorMax (equal for a corner). Set the pivot to match the
anchor. A top-right element left at pivot (0.5, 0.5) sits half off-screen. Then offsets, which
set earlier would mean something else a moment later.
Visibility checklist — run all six before concluding anything is wrong elsewhere:
SetSiblingIndex(n);
SetAsFirstSibling() puts it under every opaque sibling and looks like a colour bug.Image has a sprite, or a colour with alpha > 0.Graphic has a CanvasRenderer on the same GameObject. The multi-Type GameObject
constructor ignores [RequireComponent], so
new GameObject("Card", typeof(RectTransform), typeof(MyGraphic)) logs and draws nothing — list
typeof(CanvasRenderer) (reference/code-built-ui.md §2).Non-zero size comes from exactly one of an explicit sizeDelta, stretch anchors with sane offsets,
or a parent Layout Group with Control Child Size on. Mixing them is §3.
When a parent has a Layout Group, the parent owns its children's RectTransforms. Anchors and
sizeDelta are overwritten every layout pass. Decide who owns size before setting any number.
| Combination | Result |
|---|---|
| ContentSizeFitter on a child whose parent controls size | Silently overridden; the component does nothing |
| Layout Group on something that must keep a fixed size | The fixed size is gone |
| Nested Layout Groups | Legal, but every level must be configured deliberately |
| A decorative graphic parented under a Layout Group | Laid out as a row — set LayoutElement.ignoreLayout = true |
ContentSizeFitter on the same object as a VerticalLayoutGroup is suspicious, not
broken; Control Child Size off does not collapse children to zero. The rebuild check,
Child Force Expand, GridLayoutGroup and what a fitter needs:
reference/layout-groups-and-scrollview.md §1.preferredHeight inside nested Layout Groups. The first-frame
value predates wrapping. Fixed LayoutElement (min = preferred = fixed, flexibleHeight = 0),
TextOverflowModes.Ellipsis, an arithmetic column budget:
reference/text-and-image-traps.md §1.A
ScrollRecton its own clips nothing and scrolls nothing. Each failure is one of the three objects incomplete.
ScrollView ScrollRect
├─ Viewport RectTransform + Mask + Image ← the Image is what the Mask stencils
│ └─ Content RectTransform + VerticalLayoutGroup + ContentSizeFitter (Vertical Fit = Preferred Size)
│ └─ items — authored, or built at runtime
└─ Scrollbar optional, a sibling of Viewport — never a child of it
Content is the one object where a Layout Group and a ContentSizeFitter belong together. Wire
content and viewport — a ScrollRect with a null content never moves. Mask brings no
Image, so a Viewport with a Mask and no Image has nothing to stencil with. Empty Content
before populating it, or the list doubles on every reopen. Failure table and clearing loop:
reference/layout-groups-and-scrollview.md §2.
Without masks, a slot pool or a repainted page replaces a ScrollRect —
reference/no-mask-lists-and-motion.md §2.
When layout is wrong, look at the parent first. The mistake is nearly always one level up.
reference/canvas-and-text.md §4TextMeshPro labels that render nothing instead of truncating, and the components a control needs.
Before calling any interactive UI done:
EventSystem in the scene, with the right input module. Zero: nothing is
clickable; two: undefined behaviour. A fresh scene has none — EventSystem.current is null until something
adds one. With Active Input Handling (Player Settings) set to Input System (New), a
StandaloneInputModule receives nothing: use InputSystemUIInputModule, guarded with
#if ENABLE_INPUT_SYSTEM if the project may build either way.GraphicRaycaster on the Canvas.Raycast Target = true on the interactive element, false on whatever is layered over it. An
element with no Graphic cannot be clicked; a transparent Image plus Transition.None is the
standard invisible hit box.Button.onClick wired, if logic was actually requested.Miss any of the first three and the UI is visually perfect and completely inert.
ColorTint multiplies, it does not replace. A pressed colour darkened from the fill displays
fill × (fill × 0.85), and a dark button goes almost black. Use a brightness multiplier,
new Color(0.85f, 0.85f, 0.85f, 1f) —
reference/procedural-graphics.md.
Animate on Time.unscaledDeltaTime, or transitions freeze on a timeScale = 0 pause screen,
and drop blocksRaycasts on a view fading out so a fast second tap is not swallowed
(reference/no-mask-lists-and-motion.md §3).
MaskableGraphic subclasses instead of 9-sliced PNGs: default UI material, sharp at any
resolution, animated by field assignment. Techniques, and a progress outline
(Image.Type.Filled fills a solid shape, not a ring):
reference/procedural-graphics.md.RectMask2D / Mask need the UI shader's clipping variants. Where those cannot compile, a
PlayMode screenshot with a mask comes back one flat colour (e.g. solid cyan), content blank, no
error: suspect a shader variant before your layout. Mask-free lists:
reference/no-mask-lists-and-motion.md."Start fresh" destroys the working parts along with the broken one — in a prefab hierarchy, every reference into it. After two failed attempts, re-verify the current state: usually an earlier change never applied, and everything since has reasoned about a hierarchy that does not exist.
uGUI passes every assertion while rendering nothing: screenshot the screen and read the image
(unity-debug). Two things a screenshot cannot do have an EditMode substitute:
Graphic produced geometry. Canvas.ForceUpdateCanvases(), then assert
the vertex count of graphic.canvasRenderer.GetMesh() (reference/code-built-ui.md §3).reference/canvas-scaler-and-anchors.md §2); real devices stay on a manual checklist.Before calling it done, state rather than assume: each new element's width and height as numbers; the EventSystem count (exactly 1) and its input module; who owns size for each element touched; the screen at a second aspect ratio — one resolution proves nothing about a CanvasScaler.
A UI request whose system is not yet determined, and runtime OnGUI HUDs (unity-game-ui), UXML/USS (unity-ui-toolkit), type scale and contrast
(unity-game-ui), multi-language text pipelines (unity-localization), sprite import metadata and
9-slice borders (unity-2d-sprites), taking the screenshots this skill tells you to read
(unity-debug).
reference/canvas-and-text.md (§1, §4)reference/code-built-ui.mdreference/canvas-scaler-and-anchors.mdreference/layout-groups-and-scrollview.mdreference/procedural-graphics.mdreference/no-mask-lists-and-motion.mdreference/text-and-image-traps.mdreference/canvas-and-text.md (opens in a new tab)reference/canvas-scaler-and-anchors.md (opens in a new tab)reference/code-built-ui.md (opens in a new tab)reference/layout-groups-and-scrollview.md (opens in a new tab)reference/no-mask-lists-and-motion.md (opens in a new tab)reference/procedural-graphics.md (opens in a new tab)reference/text-and-image-traps.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub tipoli5890/game-studio --plugin unity-dev51 skills in this plugin
/unity-2d-animationSkeletal 2D characters: PSB rig, bones and weights, sprite swaps, 2D IK (2D Animation package)./unity-2d-controllerMove a 2D character: platformer jump, slopes, coyote time, moving platforms, top-down movement./unity-2d-gridGrid tactics and tile puzzles, hex or square: move range, A* paths, line of sight, turns, undo./unity-2d-level2D level layout as data: Tiled/LDtk import, rooms, endless chunks, seeded levels, jump reachability.