ue-actor-component-arc…
Use this skill when working with Actor and component design in Unreal Engine. Triggers on:…
Use this skill when working with UMG, UI, widget, UserWidget, Slate, HUD, BindWidget, Common UI, menu, or UMG binding in Unreal Engine. See references/widget-types.md for widget type reference and references/common-ui-setup.md for Common UI plugin setup. For Slate in editor
$ npx -y skills add quodsoler/unreal-engine-skills --skill ue-ui-umg-slate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/ue-ui-umg-slateContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this skill when working with UMG, UI, widget, UserWidget, Slate, HUD, BindWidget, Common UI, menu, or UMG binding in Unreal Engine. See references/widget-types.md for widget type reference and references/common-ui-setup.md for Common UI plugin setup. For Slate in editor
name: ue-ui-umg-slate description: "Use this skill when working with UMG, UI, widget, UserWidget, Slate, HUD, BindWidget, Common UI, menu, or UMG binding in Unreal Engine. See references/widget-types.md for widget type reference and references/common-ui-setup.md for Common UI plugin setup. For Slate in editor tools, see ue-editor-tools. For input mode management, see ue-input-system." metadata: version: 1.0.0
You are an expert in Unreal Engine's UI systems (UMG, Slate, and Common UI).
Read `.agents/ue-project-context.md` to determine: which UI plugins are enabled (CommonUI, MVVM), target platforms (affects input method), whether this is multiplayer (widget ownership per player), and existing UI base class conventions.
Before writing UI code, confirm: UI type (HUD, full-screen menu, modal, in-world WidgetComponent), input requirements (mouse, gamepad, keyboard), target platforms, and widget lifecycle (persistent, transient, or pooled).
---
// MyWidget.h
UCLASS()
class MYGAME_API UMyWidget : public UUserWidget
{
GENERATED_BODY()
protected:
virtual void NativeConstruct() override; // Bind delegates here — BindWidget refs valid
virtual void NativeDestruct() override;
virtual void NativeTick(const FGeometry& MyGeometry, float InDeltaTime) override;
};
// MyWidget.cpp
void UMyWidget::NativeConstruct()
{
Super::NativeConstruct();
if (PlayButton)
PlayButton->OnClicked.AddDynamic(this, &UMyWidget::HandlePlayClicked);
}// Creation — always pass the owning PlayerController for player-UI UMyWidget* Widget = CreateWidget<UMyWidget>(GetOwningPlayer(), MyWidgetClass); Widget->AddToViewport(0); // ZOrder: higher = on top. Roots the widget (won't GC). Widget->AddToPlayerScreen(0); // Split-screen: ties to a specific player's viewport region Widget->RemoveFromParent(); // Un-roots — may be GC'd if no UPROPERTY holds it. UPROPERTY() TObjectPtr<UMyWidget> CachedWidget; // Strong ref keeps alive after RemoveFromParent // Visibility Widget->SetVisibility(ESlateVisibility::Collapsed); // Not drawn, takes no space Widget->SetVisibility(ESlateVisibility::Hidden); // Not drawn, takes space Widget->SetVisibility(ESlateVisibility::Visible); // Drawn, receives input // HitTestInvisible: drawn, passes input through; SelfHitTestInvisible: children receive input
---
UCLASS()
class MYGAME_API UMyWidget : public UUserWidget
{
GENERATED_BODY()
protected:
UPROPERTY(meta=(BindWidget)) // Required — compiler warning if absent in UMG BP
TObjectPtr<UButton> PlayButton;
UPROPERTY(meta=(BindWidgetOptional)) // Optional — always null-check before use
TObjectPtr<UTextBlock> SubtitleText;
UPROPERTY(meta=(BindWidgetAnim), Transient) // Transient is required for anim bindings
TObjectPtr<UWidgetAnimation> IntroAnim;
UPROPERTY(meta=(BindWidget)) TObjectPtr<UTextBlock> ScoreText;
UPROPERTY(meta=(BindWidget)) TObjectPtr<UImage> PlayerAvatar;
UPROPERTY(meta=(BindWidget)) TObjectPtr<UProgressBar> HealthBar;
UPROPERTY(meta=(BindWidget)) TObjectPtr<UListView> ItemList;
UPROPERTY(meta=(BindWidget)) TObjectPtr<UScrollBox> ContentScroll; // Scrollable container
};Name must match the UMG Blueprint widget name exactly (case-sensitive). Always null-check optional bindings.
---
// Delegates: OnClicked, OnPressed, OnReleased, OnHovered, OnUnhovered PlayButton->OnClicked.AddDynamic(this, &UMyWidget::HandlePlayClicked); PlayButton->OnHovered.AddDynamic(this, &UMyWidget::HandlePlayHovered); PlayButton->SetColorAndOpacity(FLinearColor(1.f, 0.8f, 0.f, 1.f)); PlayButton->SetIsEnabled(false); // UE5.2+: WidgetStyle, ColorAndOpacity, ClickMethod direct access deprecated — use setters
// SetText wipes any Blueprint binding on Text
ScoreText->SetText(FText::Format(NSLOCTEXT("HUD", "ScoreFmt", "Score: {0}"), FText::AsNumber(Score)));
ScoreText->SetColorAndOpacity(FSlateColor(FLinearColor::White));
ScoreText->SetTextTransformPolicy(ETextTransformPolicy::ToUpper);
ScoreText->SetTextOverflowPolicy(ETextOverflowPolicy::Ellipsis);PlayerAvatar->SetBrushFromTexture(AvatarTexture, /*bMatchSize=*/false);
PlayerAvatar->SetBrushFromMaterial(IconMaterial);
UMaterialInstanceDynamic* MID = PlayerAvatar->GetDynamicMaterial();
MID->SetScalarParameterValue(TEXT("Opacity"), 0.5f);
PlayerAvatar->SetBrushFromSoftTexture(SoftTextureRef, false); // Async stream
PlayerAvatar->SetColorAndOpacity(FLinearColor(1.f, 1.f, 1.f, 0.5f));HealthBar->SetPercent(CurrentHealth / MaxHealth); // 0.0–1.0 HealthBar->SetFillColorAndOpacity(FLinearColor(0.f, 1.f, 0.f, 1.f)); LoadingBar->SetIsMarquee(true); // Indeterminate animation
`UScrollBox` is a BindWidget-compatible container for scrollable content. Supports vertical and horizontal scroll. Add child widgets in Blueprint; query or modify scroll offset in C++:
ContentScroll->ScrollToEnd(); ContentScroll->SetScrollOffset(0.f); ContentScroll->SetOrientation(Orient_Vertical); // default
`UListView` — virtualised vertical list. `UTileView` — same interface, displays items in a grid layout (set tile width/height in the widget Designer panel). Both use `IUserObjectListEntry`.
// Entry widget must implement the interface
UCLASS()
class UItemEntryWidget : public UUserWidget, public IUserObjectListEntry
{
GENERATED_BODY()
UPROPERTY(meta=(BindWidget)) TObjectPtr<UTextBlock> NameText;
protected:
virtual void NativeOnListItemObjectSet(UObject* ListItemObject) override
{
IUseA collection of 27 AI agent skills for Unreal Engine C++ development. Built for game developers who want AI coding agents to help write correct, production-quality UE5 C++ code.
Use this skill when working with Actor and component design in Unreal Engine. Triggers on:…
Use this skill when implementing AI, AIController, behavior tree, blackboard, AI perception,…
Use this skill when working with Unreal Engine animation: AnimInstance, montage playback,…
Use this skill when working with Unreal Engine async operations, threading, parallel…
Use this skill when working with audio, sound, music, UAudioComponent, PlaySoundAtLocation,…
Use this skill when working with character movement, CharacterMovementComponent, CMC,…