/unreal-skills:key-indicator-helperfrom Unreal Harness Skills
Renders a "press this key" indicator on screen with a glyph on a key-shaped tile. Handles the hard layout math: centering on the beveled cap's top face, font sizing, and square↔wide cap switching. Ships a C++ UMG widget template.
Ships in Unreal Harness Skills. 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.
You need to tell the player "press F" (or W, SPACE, SHIFT, LMB). The right way to do
that is a rendered key indicator — a small key-shaped texture (a keycap / square tile /
pill) with the key's glyph painted on its top face — not bracketed plain text like
[F]. This skill owns the part that is deceptively hard to get right, gives you a drop-in
widget that encapsulates it, and tells you exactly how to size and verify it. It references
no project-specific art — you bring the texture; the method is universal.
A key-shaped texture is a small picture with a 3D-ish bevel/skirt and a flat top face. Four traps sink the naive "drop a TextBlock in the middle" approach:
(cx, cy) fraction
you get from the /see skill, confirmed by eye on its annotated PNG.FontOfBox ≈ 0.30). Bigger and it looks like a filled tile; the cap should read larger
than its glyph.trimmed_height ÷ canvas_height, from /see) when you
compute the box height — otherwise the cap renders smaller than you asked.Plus two structural facts: single-char vs multi-char keys want different art (a square cap
for F, a wide cap for SPACE/SHIFT, with its own face center), and the cap should be
caller-sized — the consumer computes a box height from its own layout band and the cap
scales everything (font, press depth) from it.
The shipped template (templates/KeyIndicatorWidget.{h,cpp}) encapsulates all of this. Your
job is to measure your art, supply it, and size the widget — the traps are already handled.
1. Get / pick the key art → a square cap texture (+ optional wide cap for SPACE/SHIFT)
2. /see it → face-center (cx,cy) fraction + opaque-body fraction, per texture
3. Import it → asset_textures_import into /Game/...
4. Drop in the template → copy KeyIndicatorWidget.{h,cpp} into the project's C++ module
5. Wire one cap → SetCapTextures + SetFaceCenters + SetGlyph, add to a panel
6. Size it → SetCapSize(boxHeight) each layout pass (math below)
7. Verify → PIE + editor_screenshot; the glyph sits ON the face, crisp
/see (do not eyeball)Run the /see skill on each cap texture:
python ${CLAUDE_SKILL_DIR}/../see/scripts/see.py path/to/keycap_square.png
python ${CLAUDE_SKILL_DIR}/../see/scripts/see.py path/to/keycap_wide.png
From its JSON + annotated PNG, record per texture:
(cx, cy) — start from centroid / interior_solid, then confirm the
top-face center by eye on the *.see.png (the bevel offsets it from the box center — this
is exactly the see "face-center caveat"). This is the most important number.bbox_solid.trimmed_size[1] ÷ image.height (the visible cap's
height as a fraction of the canvas). Used in the sizing math.image.aspect of the wide cap (the template reads this from the texture
automatically, but you'll want it for layout).A square cap with a beveled top face typically lands near (0.50, 0.41); a wide cap near
(0.50, 0.46). Treat those as a sanity range, not a substitute for measuring yours.
No key art yet? Any front-on keycap/square-tile PNG with a transparent background works (a light cap with a dark face for dark glyphs, or a dark cap for light glyphs). To generate an on-theme cap, use the
/iconskill (--themeto match your game) — it needs an OpenAI key (the/onboardskill sets it up, or you're prompted on first generation). Or hand-author / source the PNG. Either way,/see+ this widget take over once you have it.
asset_textures_import (MCP asset domain) brings the PNG into /Game/.... Keep the import
path stable — the widget loads it by path or you pass the UTexture2D* in.
Copy templates/KeyIndicatorWidget.h and .cpp into the consuming project's C++ module
(Source/<Module>/UI/), then make two edits:
KEYINDICATOR_API with the project's module API macro (e.g. HOVERBALL_API).Wire one cap from your HUD / widget:
UKeyIndicatorWidget* Cap = CreateWidget<UKeyIndicatorWidget>(this, UKeyIndicatorWidget::StaticClass());
Cap->SetCapTextures(SquareTex, WideTex); // WideTex may be null
Cap->SetFaceCenters(FVector2D(0.50f, 0.41f), // ← YOUR measured square face center
FVector2D(0.50f, 0.46f)); // ← YOUR measured wide face center
Cap->SetGlyphFromKey(EKeys::F); // or SetGlyph(FText::FromString("F"))
MyPanel->AddChildToHorizontalBox(Cap); // any panel slot
Then drive its size every layout pass from your own layout. The cap is a USizeBox; you
tell it a box height and it scales the font and press depth from that.
Compute the cap-box height from the space you have, then call SetCapSize. Re-run on viewport
resize (in NativeTick, when MyGeometry.GetLocalSize().Y changes — that's the DPI-corrected
viewport height for a viewport-added widget; reliable, unlike GetViewportSize at construct):
void UMyPromptWidget::NativeTick(const FGeometry& G, float Dt)
{
Super::NativeTick(G, Dt);
const float H = G.GetLocalSize().Y;
if (H > 1.f && !FMath::IsNearlyEqual(H, LastLayoutH, 0.5f)) { ApplyLayout(H); LastLayoutH = H; }
}
void UMyPromptWidget::ApplyLayout(float ViewportH)
{
// Want the VISIBLE cap to be ~6% of viewport height. Divide by the opaque-body
// fraction (from /see) so the transparent padding doesn't shrink the visible cap.
constexpr float VisibleCapOfViewport = 0.06f; // tune to taste
constexpr float OpaqueBodyFrac = 0.695f; // ← from /see (trimmed_h ÷ canvas_h)
const float CapBoxH = (ViewportH * VisibleCapOfViewport) / OpaqueBodyFrac;
Cap->SetCapSize(CapBoxH);
}
If the cap sits inside a band/plaque (a prompt strip) rather than the raw viewport, scale
relative to the band height instead: CapBoxH = (BandPx * KeyFillOfBand) / OpaqueBodyFrac,
where KeyFillOfBand (~0.4) is how much of the band's height the visible cap should fill, and
BandPx comes from your plaque layout. Same idea — always divide by the opaque-body fraction.
SetGlyph switches automatically: a label longer than one character (SPACE, SHIFT, CTRL,
ENT, LMB) uses the wide texture if you supplied one (with the wide face center and the
texture's own aspect); single characters use the square cap. If you pass no wide texture,
multi-char labels stay on the square cap (they'll just be cramped — supply a wide cap for a
clean result). KeyLabel(FKey) produces the terse cap text (SPACE, SHIFT, LMB, ENT,
or a single uppercase letter) and is static so a controls table can share it.
For a tutorial / onboarding prompt that says "now press these," enable the looped press animation and phase-offset a row of caps so they ripple instead of pressing in unison:
// A row of caps: W A S D, rippling left-to-right.
const float RippleStep = 0.18f; // seconds of phase offset per cap
for (int32 i = 0; i < Keys.Num(); ++i)
{
UKeyIndicatorWidget* Cap = CreateWidget<UKeyIndicatorWidget>(this, UKeyIndicatorWidget::StaticClass());
Cap->SetCapTextures(SquareTex, WideTex);
Cap->SetFaceCenters(SquareFace, WideFace);
Cap->SetGlyphFromKey(Keys[i]);
Cap->SetPressCTAEnabled(true);
Cap->SetPressPhaseOffset(i * RippleStep); // ripple, not unison
Row->AddChildToHorizontalBox(Cap);
}
The animation is a code-driven render-transform (down → hold → release → pause, looped) — no
UWidgetAnimation asset. A static prompt (e.g. an interaction "[F] Open") simply leaves the
CTA off (the default).
SetGlyphFromKey(FKey) shows whatever key you hand it. To show the live bound key (so a
rebind reflects in the prompt), resolve the FKey from your project's input/settings system
first, then pass it in — e.g. read the Enhanced Input mapping for the action, or your
settings subsystem's override, falling back to the default. The widget deliberately does not
know your binding system; keep that resolution in the project and feed it the resulting FKey.
The C++ template is preferred — it paints crisp Slate fonts the immediate-mode HUD canvas
cannot, and encapsulates the math. But if a project can't take a C++ widget, the same method
works through the MCP widget domain (widget_create, widget_add_child,
widget_set_property): build a Canvas/Overlay with an Image (the cap texture) and a
TextBlock (the glyph) as siblings, and set the TextBlock's anchor to the measured face
center + alignment (0.5, 0.5) + the down-nudge, and its font size to ~⅓ of the cap box.
The hard numbers (face center, opaque-body fraction) come from /see either way — only the
wiring differs. Lose the press animation unless you script it via a widget animation.
editor_screenshot (GUI mode for render — see tests/run.ps1 --ue-mode=gui)./see and re-look — almost every defect traces to a wrong face-center
fraction or a missing opaque-body divide./see (run + verified
by eye), not from a remembered constant. The defaults in the template are a starting estimate
for a typical beveled cap and are explicitly there to be overwritten./see is a hard dependency for correctness — it's the measurement half of this skill.
This skill is the wiring half.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub oliver-io/unreal-harness --plugin unreal-skills22 skills in this plugin
/architectWrite or update an architecture document for an Unreal Engine system — a conceptual spec a senior engineer can build from. Use when someone wants to "document this system", "write an architecture doc", "spec a feature before building it", "describe how X works for the team", or "update the docs to match the code". Plan-only and code-free: it researches the live editor, Blueprints, and source, then writes a Design-level document about intent, boundaries, contracts, and invariants — no implementation, no builds, no editor mutation. Works in any UE project, not one studio's house style./automated-testerSet up an automated, agent-observed end-to-end test (or a guarded dev loop) for an Unreal feature in this harness. Use when someone wants to "add a test", "test this feature end-to-end", "verify X works in PIE", "build a verification harness", "guard this feature with a test", or "make a guardrail loop for an agent building X". Opinionated: the engine constructs the scenario via typed C++ primitives, the agent observes the behaviour it controls through a DIFFERENT read primitive, no mocks, headless-first. Encodes docs/TESTING.md./bootstrapCreate a new Unreal Engine project under projects/ wired to this repo's UnrealMCP plugin and pre-configured with the recommended engine built-in plugins (Niagara, Water, GeometryScripting, GAS, StateTree, animation, runtime mesh, etc.), and give the project its own agent-facing CLAUDE.md. Use when someone wants to "bootstrap a project", "make a new UE project", "scaffold a test/sandbox project", get a fresh project to drive with the MCP, or "write a CLAUDE.md for this game". Produces a minimal C++ host project that loads the plugin from this repo (no copy) and builds against the engine at UNREAL_ENGINE_ROOT. Asks the intended architecture (C++-first vs Blueprint-first, single- vs multiplayer) and writes a project CLAUDE.md tuned to the answers; can also adopt an existing project by exploring it and writing a CLAUDE.md that describes it.