[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FD17V969W760SAD3E98FWW":3,"skill-same:01M7FD17V969W760SAD3E98FWW":84},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M7FD17V969W760SAD3E98FWW","unreal",null,"Use when building, scripting or debugging a game in Unreal Engine 5 with Blueprint or C++ — the gameplay framework (Actor, Pawn, Character, GameMode, PlayerController), Actor lifecycle and tick, the reflection macros and garbage collection, Enhanced Input, multicast delegates, UMG widgets, Paper2D, and Blueprint-to-C++ parity in both directions. NOT Godot (that is `godot`), NOT Unity or MonoBehaviour (that is `unity`), NOT language-only C++ memory and RAII questions with no Unreal types (that is `cpp`).","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Funreal\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: unreal\ndescription: \"Use when building, scripting or debugging a game in Unreal Engine 5 with Blueprint or C++ — the gameplay framework (Actor, Pawn, Character, GameMode, PlayerController), Actor lifecycle and tick, the reflection macros and garbage collection, Enhanced Input, multicast delegates, UMG widgets, Paper2D, and Blueprint-to-C++ parity in both directions. NOT Godot (that is `godot`), NOT Unity or MonoBehaviour (that is `unity`), NOT language-only C++ memory and RAII questions with no Unreal types (that is `cpp`).\"\ntags: [unreal, ue5, blueprint, unreal-engine, gamedev]\nrecommends: [cpp, gamedev-shipping, gamedev-multiplayer, game-design, gamedev-physics, godot, unity]\nprofiles: [full]\norigin: risco\n---\n\n# Unreal Engine 5 (Blueprint + C++)\n\nBuild and debug UE5 games with the grain of the engine: the Gameplay Framework for structure,\nreflection macros so C++ and Blueprint see the same types, Enhanced Input for controls, UMG for\nUI, Paper2D for 2D — and a clean Blueprint↔C++ boundary so either can call the other. Hands\n3D-only concerns (shaders, physics, netcode, shipping) to the siblings below.\n\n## Version contract — read first\n\nTarget **Unreal Engine 5.x** (patterns valid 5.3+; current stable **UE 5.8**, the last UE5 line\nbefore UE6). Emit modern UE5 APIs only. **Never emit these deprecated \u002F legacy patterns:**\n\n| Never emit | Use instead (UE5) |\n| --- | --- |\n| Legacy input: Project-Settings Action\u002FAxis Mappings + `InputComponent->BindAction\u002FBindAxis(FName,…)` | **Enhanced Input**: `UInputAction` + `UInputMappingContext` + `UEnhancedInputComponent->BindAction(…)`, context added via `UEnhancedInputLocalPlayerSubsystem` (default since 5.1; legacy deprecated 5.2) |\n| Raw `UObject*` \u002F `AActor*` as a **UPROPERTY member** | `TObjectPtr\u003CT>` for UPROPERTY members (raw `T*` is fine for locals\u002Fparams) |\n| `GENERATED_UCLASS_BODY()` | `GENERATED_BODY()` |\n| `TAssetPtr\u003CT>` \u002F `FStringAssetReference` | `TSoftObjectPtr\u003CT>` \u002F `FSoftObjectPath` |\n| `ANY_PACKAGE` in `FindObject` \u002F `StaticLoadObject` | explicit package or `FTopLevelAssetPath` |\n| Slate\u002FCanvas `DrawText`\u002F`HUD` for game UI | **UMG** (`UUserWidget`) |\n| `AGameMode` as the default base for a solo game | `AGameModeBase` (use `AGameMode` only when you need `MatchState`\u002Fmultiplayer login flow) |\n| `DECLARE_MULTICAST_DELEGATE` for a Blueprint-bindable event | `DECLARE_DYNAMIC_MULTICAST_DELEGATE…` + `BlueprintAssignable` |\n| `bCanEverTick = true` \"just in case\" | leave tick **off**; drive logic from events\u002Foverlaps\u002Ftimers (`FTimerManager`) |\n| Hard-referencing \u002F loading heavy assets at runtime by path | soft refs + `FStreamableManager` async load (hard refs only via `ConstructorHelpers` in the constructor) |\n\n**Blueprint vs C++ — and the hybrid.** Blueprint: designer-facing tweaks, per-level scripting,\nUI wiring, rapid iteration, one-off actors. C++: core systems, performance-critical\u002Ftick-heavy\ncode, base classes, math, anything you want unit-tested or diffable in git. **Default to the\nhybrid**: write the base class in C++ (`UCLASS(Blueprintable)`), expose tunables with\n`UPROPERTY(EditAnywhere, BlueprintReadWrite)` and hooks with `BlueprintImplementableEvent` \u002F\n`BlueprintNativeEvent`, then create a **Blueprint subclass** for designers to set defaults, wire\nassets, and script the specifics — C++ speed and testability with Blueprint iteration.\n\n## Gameplay Framework — who owns what\n\n| Class | Responsibility | Lifetime \u002F scope |\n| --- | --- | --- |\n| `AActor` | Anything placeable\u002Fspawnable in a level; holds components. | Per instance in a level\u002Fworld |\n| `UActorComponent` \u002F `USceneComponent` | Reusable behavior\u002Fdata on an Actor; `USceneComponent` adds a transform. | Owned by its Actor |\n| `APawn` | An Actor that can be **possessed** and driven by a controller. | Per instance |\n| `ACharacter` | A Pawn with a `CapsuleComponent`, `SkeletalMesh`, and `CharacterMovementComponent` (walk\u002Fjump\u002Fcrouch, networked). | Per instance |\n| `AController` \u002F `APlayerController` \u002F `AAIController` | The \"brain\" that possesses a Pawn; `APlayerController` maps a human player to input, camera, and UI. | One per player\u002FAI |\n| `APlayerState` | Per-player **replicated** state that must survive respawn (name, score, team). | One per player |\n| `AGameModeBase` | The rules of the match; spawns players, defines default Pawn\u002FController\u002FHUD classes. **Server-only** — never exists on clients. | One per level |\n| `AGameStateBase` | Game-wide **replicated** state all clients need (match phase, shared score, player array). | One, replicated |\n| `AHUD` \u002F `UUserWidget` | On-screen UI; prefer UMG `UUserWidget` over `AHUD` canvas drawing. | Per PlayerController |\n\nRule of thumb: **transient input\u002Fcamera → PlayerController; persistent per-player data →\nPlayerState; match rules → GameMode (server); shared world state → GameState.** Full\nresponsibilities and a spawn-order diagram → `references\u002Fgameplay-framework.md`.\n\n## Actor lifecycle, components & attachment\n\nOrder for a spawned\u002Fplaced Actor: **constructor** (set defaults, create subobjects — never\ngameplay logic) → `PostInitializeComponents` → `BeginPlay` (world is live; safe to start logic)\n→ `Tick(DeltaSeconds)` each frame (only if enabled) → `EndPlay` \u002F `Destroyed` (release).\n\n```cpp\nAMyActor::AMyActor()\n{\n    PrimaryActorTick.bCanEverTick = false;                         \u002F\u002F opt in only if you truly tick\n    RootComponent = CreateDefaultSubobject\u003CUSceneComponent>(TEXT(\"Root\"));\n    Mesh = CreateDefaultSubobject\u003CUStaticMeshComponent>(TEXT(\"Mesh\"));\n    Mesh->SetupAttachment(RootComponent);                          \u002F\u002F attach in the CONSTRUCTOR\n}\nvoid AMyActor::BeginPlay() { Super::BeginPlay(); \u002F* start logic here, not in ctor *\u002F }\n```\n\n- **Create components** with `CreateDefaultSubobject\u003CT>(TEXT(\"Name\"))` in the constructor; store\n  them in a `UPROPERTY() TObjectPtr\u003CT>` so they're kept alive and visible.\n- **Attach in the constructor** with `SetupAttachment`; **at runtime** use\n  `AttachToComponent(Parent, FAttachmentTransformRules::SnapToTargetNotIncludingScale)`.\n- Prefer timers over tick for periodic work:\n  `GetWorldTimerManager().SetTimer(Handle, this, &AMyActor::Fn, 1.f, true);`\n\n## Reflection macros & garbage collection\n\nMacros register types with Unreal Header Tool (UHT) so they get GC, serialization, editor, and\nBlueprint support. Put `GENERATED_BODY()` first inside the class.\n\n```cpp\nUENUM(BlueprintType)\nenum class ETeam : uint8 { Red, Blue };\n\nUSTRUCT(BlueprintType)                       \u002F\u002F value type, visible to BP; no GC of itself\nstruct FLoadout { GENERATED_BODY()\n    UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 Ammo = 30;\n};\n\nUCLASS(Blueprintable)                        \u002F\u002F Blueprintable = can be subclassed in BP\nclass MYGAME_API AWeapon : public AActor {\n    GENERATED_BODY()\npublic:\n    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=\"Combat\") float Damage = 10.f;\n    UPROPERTY(VisibleAnywhere) TObjectPtr\u003CUStaticMeshComponent> Mesh;   \u002F\u002F GC-tracked ref\n    UFUNCTION(BlueprintCallable, Category=\"Combat\") void Fire();\n};\n```\n\nCommon `UPROPERTY` specifiers: `EditAnywhere` (edit on instances + defaults),\n`EditDefaultsOnly` (class defaults only), `VisibleAnywhere` (read-only in editor);\n`BlueprintReadWrite` (get + set in BP) vs `BlueprintReadOnly` (get only); always give a\n`Category`.\n\n**Garbage collection — the #1 gotcha.** The GC frees any `UObject` that no reachable `UPROPERTY`\npoints to. A UObject reference stored **without** `UPROPERTY()` is invisible to GC: it will be\ncollected out from under you and the pointer dangles\u002Fcrashes. So:\n\n- Store every long-lived `UObject`\u002F`AActor` reference in a `UPROPERTY() TObjectPtr\u003CT>`.\n- For a non-owning \"might already be dead\" reference (don't keep it alive, must null-check), use\n  `TWeakObjectPtr\u003CT>` and `.IsValid()`.\n- Never `new`\u002F`delete` a `UObject` — spawn Actors with `SpawnActor\u003CT>()` and create other UObjects\n  with `NewObject\u003CT>()`; the GC owns their lifetime. `new`\u002F`delete` and smart pointers apply only\n  to **non-`UObject`** C++ types.\n\n## Delegates & events\n\n```cpp\n\u002F\u002F Dynamic multicast = Blueprint-assignable + serializable. Params need a typed macro variant.\nDECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnHealthChanged, float, NewHealth);\n\nUPROPERTY(BlueprintAssignable, Category=\"Events\")     \u002F\u002F shows as a red event node in BP\nFOnHealthChanged OnHealthChanged;\n\n\u002F\u002F C++ side: bind and fire.\nOnHealthChanged.AddDynamic(this, &AMyActor::HandleHealth);   \u002F\u002F dynamic → AddDynamic + UFUNCTION\nOnHealthChanged.Broadcast(NewHealth);\n```\n\nUse a **dynamic** multicast delegate whenever Blueprint must bind to the event (`BlueprintAssignable`);\nits handler must be a `UFUNCTION`. Use a plain `DECLARE_MULTICAST_DELEGATE…` (bind with\n`AddUObject`\u002F`AddLambda`) only for C++-to-C++ events that never touch Blueprint. Overlap\u002Fhit\nevents (`OnComponentBeginOverlap`, `OnActorHit`) are already dynamic multicast — bind with\n`AddDynamic`.\n\n## Blueprint ↔ C++ parity\n\nSame graph, two languages. Left = the Blueprint node; right = the C++ that does the same thing.\n\n| Blueprint node | C++ |\n| --- | --- |\n| Event **BeginPlay** | `virtual void BeginPlay() override;` (call `Super::BeginPlay()`) |\n| Event **Tick (Delta Seconds)** | `virtual void Tick(float DeltaSeconds) override;` |\n| **Spawn Actor from Class** | `GetWorld()->SpawnActor\u003CAWeapon>(Class, Loc, Rot);` |\n| **Cast To** `X` | `if (AX* P = Cast\u003CAX>(Obj)) { … }` (always null-check) |\n| **Set Timer by Event** | `GetWorldTimerManager().SetTimer(H, this, &A::Fn, Rate, bLoop);` |\n| **Print String** | `UE_LOG(LogTemp, Warning, TEXT(\"v=%d\"), V);` \u002F `GEngine->AddOnScreenDebugMessage(...)` |\n| **Get Player Controller** | `UGameplayStatics::GetPlayerController(this, 0);` |\n| **Bind Event to** `OnClicked` | `Button->OnClicked.AddDynamic(this, &U::Fn);` |\n\n**Expose C++ → Blueprint:**\n\n```cpp\nUFUNCTION(BlueprintCallable, Category=\"X\") void DoThing();     \u002F\u002F callable node (has exec pins)\nUFUNCTION(BlueprintPure,     Category=\"X\") int32 GetScore() const;  \u002F\u002F pure node (no exec pins)\nUPROPERTY(EditAnywhere, BlueprintReadWrite) float Speed = 600.f;    \u002F\u002F exposed variable\n```\n\n**Call Blueprint ← C++** (the hybrid hooks — declare in C++, implement\u002Foverride in the BP subclass):\n\n```cpp\n\u002F\u002F No C++ body — Blueprint provides the whole implementation. C++ just calls OnScored().\nUFUNCTION(BlueprintImplementableEvent) void OnScored(int32 Points);\n\n\u002F\u002F C++ gives a default; Blueprint may override. Implement the C++ default in OnDamaged_Implementation.\nUFUNCTION(BlueprintNativeEvent) void OnDamaged(float Amount);\nvoid AMyActor::OnDamaged_Implementation(float Amount) { Health -= Amount; }\n\u002F\u002F Call the event from C++ by its plain name: OnScored(10);  OnDamaged(5.f);\n```\n\nMapping table (every specifier), full expose\u002Foverride examples, and the C++-base-+-BP-subclass\nworkflow → `references\u002Fblueprint-cpp-parity.md`.\n\n## UMG (UI)\n\nUI is a `UUserWidget` (design the visuals in a WBP asset; drive logic in C++ or its BP graph).\nBind C++ members to named widgets with `meta=(BindWidget)` — the C++ name must match the WBP\nwidget.\n\n```cpp\nUCLASS() class UHealthWidget : public UUserWidget { GENERATED_BODY()\n    UPROPERTY(meta=(BindWidget)) TObjectPtr\u003CUProgressBar> HealthBar;   \u002F\u002F name matches WBP\n    UFUNCTION(BlueprintCallable) void SetHealth(float Pct);\n};\n\u002F\u002F Create + show from a PlayerController:\nUHealthWidget* W = CreateWidget\u003CUHealthWidget>(PC, WidgetClass);\nW->AddToViewport();\n```\n\nLayout with panels (Canvas\u002FV-H Box\u002FOverlay\u002FGrid); `SetVisibility`,\n`RemoveFromParent` to hide\u002Fclose; anchors + a design resolution for scaling.\n\n## Paper2D (2D)\n\nEnable the Paper2D plugin. Core types:\n\n- **Sprite** (`UPaperSprite` asset, `UPaperSpriteComponent`) — a single textured quad.\n- **Flipbook** (`UPaperFlipbook` asset, `UPaperFlipbookComponent`) — frames + FPS = animation;\n  `SetFlipbook(...)` to swap states (idle\u002Frun\u002Fjump).\n- **`APaperCharacter`** — a `ACharacter` whose mesh is a flipbook; you get\n  `CharacterMovementComponent` (walk\u002Fjump) for free, driven by Enhanced Input just like 3D.\n- **Tile maps** (`UPaperTileMap`, `UPaperTileMapComponent`) for level geometry.\n\n2D uses the same Gameplay Framework, Enhanced Input, and lifecycle as 3D — only the visual\ncomponents differ. Constrain movement to a plane and use an orthographic camera.\n\n## Packaging & build config (brief)\n\n- **Build configurations**: `Debug`, `DebugGame`, `Development` (default for iteration —\n  optimized engine, hot-reloadable game code), `Shipping` (fully optimized, logging\u002Fconsole\n  stripped — ship this), `Test`.\n- **Target files** (`*.Target.cs`) define Game\u002FEditor\u002FClient\u002FServer targets; **module rules**\n  (`*.Build.cs`) declare module dependencies (e.g. `\"EnhancedInput\"`, `\"UMG\"`, `\"Paper2D\"`).\n- Package from **Platforms ▸ \u003Ctarget> ▸ Package Project**, or automate with\n  `RunUAT BuildCookRun` (cook content → stage → package). Per-platform settings live in\n  `Config\u002FDefaultGame.ini` \u002F `Default\u003CPlatform>Engine.ini`.\n\nThis is the minimum. Deep shipping — cooking, pak\u002FIoStore, certification, size\u002Fperf budgets, CI —\nis owned by [`gamedev-shipping`](..\u002Fgamedev-shipping\u002FSKILL.md). Overview + a starter `.Build.cs` →\n`references\u002Fpackaging.md`.\n\n## Guardrails & gotchas\n\n- **UPROPERTY-or-GC'd**: any UObject ref you keep must be a `UPROPERTY()` or it will be garbage\n  collected and crash. This is the most common Unreal C++ bug.\n- **Enhanced Input only** — no legacy Action\u002FAxis mappings; add the `UInputMappingContext` via the\n  local player subsystem in `BeginPlay`\u002Fon-possess, bind actions on `UEnhancedInputComponent`.\n- **GameMode is server-only** — never read it on a client; put client-visible state on GameState\n  or PlayerState and replicate.\n- **No gameplay in the constructor** — the world isn't ready. Do it in `BeginPlay`.\n- **Always null-check `Cast\u003CT>()`** and `SpawnActor` results; they can return `nullptr`.\n- **Don't `new`\u002F`delete` UObjects** — `NewObject`\u002F`SpawnActor` and let GC free them. Header\n  changes need a full editor recompile (Live Coding covers `.cpp` bodies only).\n- **Regenerate project files** after adding classes\u002Fmodules; add module deps in `*.Build.cs`\n  (missing `\"EnhancedInput\"`\u002F`\"UMG\"` = linker errors).\n- **Multiplayer**: replicate state with `UPROPERTY(Replicated)`, gate server actions behind\n  `HasAuthority()` → see `gamedev-multiplayer`.\n\n## Related skills\n\n- [`cpp`](..\u002Fcpp\u002FSKILL.md) — plain C++\u002FRAII\u002Fsmart-pointer ownership for **non-UObject** code; this\n  skill owns the Unreal reflection + GC model layered on top.\n- [`gamedev-shipping`](..\u002Fgamedev-shipping\u002FSKILL.md) — deep cooking\u002Fpackaging\u002Fstore submission.\n- [`gamedev-multiplayer`](..\u002Fgamedev-multiplayer\u002FSKILL.md) — replication, RPCs, authority.\n- [`gamedev-physics`](..\u002Fgamedev-physics\u002FSKILL.md) — Chaos physics, collision, constraints.\n- [`game-design`](..\u002Fgame-design\u002FSKILL.md) — mechanics\u002Floops before you build them.\n- [`godot`](..\u002Fgodot\u002FSKILL.md) \u002F [`unity`](..\u002Funity\u002FSKILL.md) — the other engines; route there\n  when the project is Godot or Unity, not Unreal.\n\n## Checklist\n\n- [ ] Correct base class chosen (Actor\u002FPawn\u002FCharacter; GameMode**Base** unless match-state needed).\n- [ ] No legacy input — Enhanced Input (`UInputAction` + `UInputMappingContext` + subsystem).\n- [ ] Every long-lived UObject\u002FActor ref is a `UPROPERTY() TObjectPtr\u003CT>` (GC-safe).\n- [ ] Components made in ctor via `CreateDefaultSubobject` + `SetupAttachment`; no logic in ctor.\n- [ ] Tick left off unless required; periodic work on a timer\u002Fevent.\n- [ ] C++↔BP boundary correct: `BlueprintCallable`\u002F`Pure` to expose, `BlueprintImplementableEvent`\u002F\n      `NativeEvent` for BP-overridable hooks; BP-bound delegates are dynamic multicast.\n- [ ] UI is UMG (`UUserWidget` + `BindWidget`), not HUD canvas drawing.\n- [ ] Server-only vs replicated state placed correctly (GameMode server-only).\n- [ ] Module deps (`EnhancedInput`\u002F`UMG`\u002F`Paper2D`) added in `*.Build.cs`; project files regenerated.\n","# Unreal Engine 5 (Blueprint + C++)\n\nBuild and debug UE5 games with the grain of the engine: the Gameplay Framework for structure,\nreflection macros so C++ and Blueprint see the same types, Enhanced Input for controls, UMG for\nUI, Paper2D for 2D — and a clean Blueprint↔C++ boundary so either can call the other. Hands\n3D-only concerns (shaders, physics, netcode, shipping) to the siblings below.\n\n## Version contract — read first\n\nTarget **Unreal Engine 5.x** (patterns valid 5.3+; current stable **UE 5.8**, the last UE5 line\nbefore UE6). Emit modern UE5 APIs only. **Never emit these deprecated \u002F legacy patterns:**\n\n| Never emit | Use instead (UE5) |\n| --- | --- |\n| Legacy input: Project-Settings Action\u002FAxis Mappings + `InputComponent->BindAction\u002FBindAxis(FName,…)` | **Enhanced Input**: `UInputAction` + `UInputMappingContext` + `UEnhancedInputComponent->BindAction(…)`, context added via `UEnhancedInputLocalPlayerSubsystem` (default since 5.1; legacy deprecated 5.2) |\n| Raw `UObject*` \u002F `AActor*` as a **UPROPERTY member** | `TObjectPtr\u003CT>` for UPROPERTY members (raw `T*` is fine for locals\u002Fparams) |\n| `GENERATED_UCLASS_BODY()` | `GENERATED_BODY()` |\n| `TAssetPtr\u003CT>` \u002F `FStringAssetReference` | `TSoftObjectPtr\u003CT>` \u002F `FSoftObjectPath` |\n| `ANY_PACKAGE` in `FindObject` \u002F `StaticLoadObject` | explicit package or `FTopLevelAssetPath` |\n| Slate\u002FCanvas `DrawText`\u002F`HUD` for game UI | **UMG** (`UUserWidget`) |\n| `AGameMode` as the default base for a solo game | `AGameModeBase` (use `AGameMode` only when you need `MatchState`\u002Fmultiplayer login flow) |\n| `DECLARE_MULTICAST_DELEGATE` for a Blueprint-bindable event | `DECLARE_DYNAMIC_MULTICAST_DELEGATE…` + `BlueprintAssignable` |\n| `bCanEverTick = true` \"just in case\" | leave tick **off**; drive logic from events\u002Foverlaps\u002Ftimers (`FTimerManager`) |\n| Hard-referencing \u002F loading heavy assets at runtime by path | soft refs + `FStreamableManager` async load (hard refs only via `ConstructorHelpers` in the constructor) |\n\n**Blueprint vs C++ — and the hybrid.** Blueprint: designer-facing tweaks, per-level scripting,\nUI wiring, rapid iteration, one-off actors. C++: core systems, performance-critical\u002Ftick-heavy\ncode, base classes, math, anything you want unit-tested or diffable in git. **Default to the\nhybrid**: write the base class in C++ (`UCLASS(Blueprintable)`), expose tunables with\n`UPROPERTY(EditAnywhere, BlueprintReadWrite)` and hooks with `BlueprintImplementableEvent` \u002F\n`BlueprintNativeEvent`, then create a **Blueprint subclass** for designers to set defaults, wire\nassets, and script the specifics — C++ speed and testability with Blueprint iteration.\n\n## Gameplay Framework — who owns what\n\n| Class | Responsibility | Lifetime \u002F scope |\n| --- | --- | --- |\n| `AActor` | Anything placeable\u002Fspawnable in a level; holds components. | Per instance in a level\u002Fworld |\n| `UActorComponent` \u002F `USceneComponent` | Reusable behavior\u002Fdata on an Actor; `USceneComponent` adds a transform. | Owned by its Actor |\n| `APawn` | An Actor that can be **possessed** and driven by a controller. | Per instance |\n| `ACharacter` | A Pawn with a `CapsuleComponent`, `SkeletalMesh`, and `CharacterMovementComponent` (walk\u002Fjump\u002Fcrouch, networked). | Per instance |\n| `AController` \u002F `APlayerController` \u002F `AAIController` | The \"brain\" that possesses a Pawn; `APlayerController` maps a human player to input, camera, and UI. | One per player\u002FAI |\n| `APlayerState` | Per-player **replicated** state that must survive respawn (name, score, team). | One per player |\n| `AGameModeBase` | The rules of the match; spawns players, defines default Pawn\u002FController\u002FHUD classes. **Server-only** — never exists on clients. | One per level |\n| `AGameStateBase` | Game-wide **replicated** state all clients need (match phase, shared score, player array). | One, replicated |\n| `AHUD` \u002F `UUserWidget` | On-screen UI; prefer UMG `UUserWidget` over `AHUD` canvas drawing. | Per PlayerController |\n\nRule of thumb: **transient input\u002Fcamera → PlayerController; persistent per-player data →\nPlayerState; match rules → GameMode (server); shared world state → GameState.** Full\nresponsibilities and a spawn-order diagram → `references\u002Fgameplay-framework.md`.\n\n## Actor lifecycle, components & attachment\n\nOrder for a spawned\u002Fplaced Actor: **constructor** (set defaults, create subobjects — never\ngameplay logic) → `PostInitializeComponents` → `BeginPlay` (world is live; safe to start logic)\n→ `Tick(DeltaSeconds)` each frame (only if enabled) → `EndPlay` \u002F `Destroyed` (release).\n\n```cpp\nAMyActor::AMyActor()\n{\n    PrimaryActorTick.bCanEverTick = false;                         \u002F\u002F opt in only if you truly tick\n    RootComponent = CreateDefaultSubobject\u003CUSceneComponent>(TEXT(\"Root\"));\n    Mesh = CreateDefaultSubobject\u003CUStaticMeshComponent>(TEXT(\"Mesh\"));\n    Mesh->SetupAttachment(RootComponent);                          \u002F\u002F attach in the CONSTRUCTOR\n}\nvoid AMyActor::BeginPlay() { Super::BeginPlay(); \u002F* start logic here, not in ctor *\u002F }\n```\n\n- **Create components** with `CreateDefaultSubobject\u003CT>(TEXT(\"Name\"))` in the constructor; store\n  them in a `UPROPERTY() TObjectPtr\u003CT>` so they're kept alive and visible.\n- **Attach in the constructor** with `SetupAttachment`; **at runtime** use\n  `AttachToComponent(Parent, FAttachmentTransformRules::SnapToTargetNotIncludingScale)`.\n- Prefer timers over tick for periodic work:\n  `GetWorldTimerManager().SetTimer(Handle, this, &AMyActor::Fn, 1.f, true);`\n\n## Reflection macros & garbage collection\n\nMacros register types with Unreal Header Tool (UHT) so they get GC, serialization, editor, and\nBlueprint support. Put `GENERATED_BODY()` first inside the class.\n\n```cpp\nUENUM(BlueprintType)\nenum class ETeam : uint8 { Red, Blue };\n\nUSTRUCT(BlueprintType)                       \u002F\u002F value type, visible to BP; no GC of itself\nstruct FLoadout { GENERATED_BODY()\n    UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 Ammo = 30;\n};\n\nUCLASS(Blueprintable)                        \u002F\u002F Blueprintable = can be subclassed in BP\nclass MYGAME_API AWeapon : public AActor {\n    GENERATED_BODY()\npublic:\n    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=\"Combat\") float Damage = 10.f;\n    UPROPERTY(VisibleAnywhere) TObjectPtr\u003CUStaticMeshComponent> Mesh;   \u002F\u002F GC-tracked ref\n    UFUNCTION(BlueprintCallable, Category=\"Combat\") void Fire();\n};\n```\n\nCommon `UPROPERTY` specifiers: `EditAnywhere` (edit on instances + defaults),\n`EditDefaultsOnly` (class defaults only), `VisibleAnywhere` (read-only in editor);\n`BlueprintReadWrite` (get + set in BP) vs `BlueprintReadOnly` (get only); always give a\n`Category`.\n\n**Garbage collection — the #1 gotcha.** The GC frees any `UObject` that no reachable `UPROPERTY`\npoints to. A UObject reference stored **without** `UPROPERTY()` is invisible to GC: it will be\ncollected out from under you and the pointer dangles\u002Fcrashes. So:\n\n- Store every long-lived `UObject`\u002F`AActor` reference in a `UPROPERTY() TObjectPtr\u003CT>`.\n- For a non-owning \"might already be dead\" reference (don't keep it alive, must null-check), use\n  `TWeakObjectPtr\u003CT>` and `.IsValid()`.\n- Never `new`\u002F`delete` a `UObject` — spawn Actors with `SpawnActor\u003CT>()` and create other UObjects\n  with `NewObject\u003CT>()`; the GC owns their lifetime. `new`\u002F`delete` and smart pointers apply only\n  to **non-`UObject`** C++ types.\n\n## Delegates & events\n\n```cpp\n\u002F\u002F Dynamic multicast = Blueprint-assignable + serializable. Params need a typed macro variant.\nDECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnHealthChanged, float, NewHealth);\n\nUPROPERTY(BlueprintAssignable, Category=\"Events\")     \u002F\u002F shows as a red event node in BP\nFOnHealthChanged OnHealthChanged;\n\n\u002F\u002F C++ side: bind and fire.\nOnHealthChanged.AddDynamic(this, &AMyActor::HandleHealth);   \u002F\u002F dynamic → AddDynamic + UFUNCTION\nOnHealthChanged.Broadcast(NewHealth);\n```\n\nUse a **dynamic** multicast delegate whenever Blueprint must bind to the event (`BlueprintAssignable`);\nits handler must be a `UFUNCTION`. Use a plain `DECLARE_MULTICAST_DELEGATE…` (bind with\n`AddUObject`\u002F`AddLambda`) only for C++-to-C++ events that never touch Blueprint. Overlap\u002Fhit\nevents (`OnComponentBeginOverlap`, `OnActorHit`) are already dynamic multicast — bind with\n`AddDynamic`.\n\n## Blueprint ↔ C++ parity\n\nSame graph, two languages. Left = the Blueprint node; right = the C++ that does the same thing.\n\n| Blueprint node | C++ |\n| --- | --- |\n| Event **BeginPlay** | `virtual void BeginPlay() override;` (call `Super::BeginPlay()`) |\n| Event **Tick (Delta Seconds)** | `virtual void Tick(float DeltaSeconds) override;` |\n| **Spawn Actor from Class** | `GetWorld()->SpawnActor\u003CAWeapon>(Class, Loc, Rot);` |\n| **Cast To** `X` | `if (AX* P = Cast\u003CAX>(Obj)) { … }` (always null-check) |\n| **Set Timer by Event** | `GetWorldTimerManager().SetTimer(H, this, &A::Fn, Rate, bLoop);` |\n| **Print String** | `UE_LOG(LogTemp, Warning, TEXT(\"v=%d\"), V);` \u002F `GEngine->AddOnScreenDebugMessage(...)` |\n| **Get Player Controller** | `UGameplayStatics::GetPlayerController(this, 0);` |\n| **Bind Event to** `OnClicked` | `Button->OnClicked.AddDynamic(this, &U::Fn);` |\n\n**Expose C++ → Blueprint:**\n\n```cpp\nUFUNCTION(BlueprintCallable, Category=\"X\") void DoThing();     \u002F\u002F callable node (has exec pins)\nUFUNCTION(BlueprintPure,     Category=\"X\") int32 GetScore() const;  \u002F\u002F pure node (no exec pins)\nUPROPERTY(EditAnywhere, BlueprintReadWrite) float Speed = 600.f;    \u002F\u002F exposed variable\n```\n\n**Call Blueprint ← C++** (the hybrid hooks — declare in C++, implement\u002Foverride in the BP subclass):\n\n```cpp\n\u002F\u002F No C++ body — Blueprint provides the whole implementation. C++ just calls OnScored().\nUFUNCTION(BlueprintImplementableEvent) void OnScored(int32 Points);\n\n\u002F\u002F C++ gives a default; Blueprint may override. Implement the C++ default in OnDamaged_Implementation.\nUFUNCTION(BlueprintNativeEvent) void OnDamaged(float Amount);\nvoid AMyActor::OnDamaged_Implementation(float Amount) { Health -= Amount; }\n\u002F\u002F Call the event from C++ by its plain name: OnScored(10);  OnDamaged(5.f);\n```\n\nMapping table (every specifier), full expose\u002Foverride examples, and the C++-base-+-BP-subclass\nworkflow → `references\u002Fblueprint-cpp-parity.md`.\n\n## UMG (UI)\n\nUI is a `UUserWidget` (design the visuals in a WBP asset; drive logic in C++ or its BP graph).\nBind C++ members to named widgets with `meta=(BindWidget)` — the C++ name must match the WBP\nwidget.\n\n```cpp\nUCLASS() class UHealthWidget : public UUserWidget { GENERATED_BODY()\n    UPROPERTY(meta=(BindWidget)) TObjectPtr\u003CUProgressBar> HealthBar;   \u002F\u002F name matches WBP\n    UFUNCTION(BlueprintCallable) void SetHealth(float Pct);\n};\n\u002F\u002F Create + show from a PlayerController:\nUHealthWidget* W = CreateWidget\u003CUHealthWidget>(PC, WidgetClass);\nW->AddToViewport();\n```\n\nLayout with panels (Canvas\u002FV-H Box\u002FOverlay\u002FGrid); `SetVisibility`,\n`RemoveFromParent` to hide\u002Fclose; anchors + a design resolution for scaling.\n\n## Paper2D (2D)\n\nEnable the Paper2D plugin. Core types:\n\n- **Sprite** (`UPaperSprite` asset, `UPaperSpriteComponent`) — a single textured quad.\n- **Flipbook** (`UPaperFlipbook` asset, `UPaperFlipbookComponent`) — frames + FPS = animation;\n  `SetFlipbook(...)` to swap states (idle\u002Frun\u002Fjump).\n- **`APaperCharacter`** — a `ACharacter` whose mesh is a flipbook; you get\n  `CharacterMovementComponent` (walk\u002Fjump) for free, driven by Enhanced Input just like 3D.\n- **Tile maps** (`UPaperTileMap`, `UPaperTileMapComponent`) for level geometry.\n\n2D uses the same Gameplay Framework, Enhanced Input, and lifecycle as 3D — only the visual\ncomponents differ. Constrain movement to a plane and use an orthographic camera.\n\n## Packaging & build config (brief)\n\n- **Build configurations**: `Debug`, `DebugGame`, `Development` (default for iteration —\n  optimized engine, hot-reloadable game code), `Shipping` (fully optimized, logging\u002Fconsole\n  stripped — ship this), `Test`.\n- **Target files** (`*.Target.cs`) define Game\u002FEditor\u002FClient\u002FServer targets; **module rules**\n  (`*.Build.cs`) declare module dependencies (e.g. `\"EnhancedInput\"`, `\"UMG\"`, `\"Paper2D\"`).\n- Package from **Platforms ▸ \u003Ctarget> ▸ Package Project**, or automate with\n  `RunUAT BuildCookRun` (cook content → stage → package). Per-platform settings live in\n  `Config\u002FDefaultGame.ini` \u002F `Default\u003CPlatform>Engine.ini`.\n\nThis is the minimum. Deep shipping — cooking, pak\u002FIoStore, certification, size\u002Fperf budgets, CI —\nis owned by [`gamedev-shipping`](..\u002Fgamedev-shipping\u002FSKILL.md). Overview + a starter `.Build.cs` →\n`references\u002Fpackaging.md`.\n\n## Guardrails & gotchas\n\n- **UPROPERTY-or-GC'd**: any UObject ref you keep must be a `UPROPERTY()` or it will be garbage\n  collected and crash. This is the most common Unreal C++ bug.\n- **Enhanced Input only** — no legacy Action\u002FAxis mappings; add the `UInputMappingContext` via the\n  local player subsystem in `BeginPlay`\u002Fon-possess, bind actions on `UEnhancedInputComponent`.\n- **GameMode is server-only** — never read it on a client; put client-visible state on GameState\n  or PlayerState and replicate.\n- **No gameplay in the constructor** — the world isn't ready. Do it in `BeginPlay`.\n- **Always null-check `Cast\u003CT>()`** and `SpawnActor` results; they can return `nullptr`.\n- **Don't `new`\u002F`delete` UObjects** — `NewObject`\u002F`SpawnActor` and let GC free them. Header\n  changes need a full editor recompile (Live Coding covers `.cpp` bodies only).\n- **Regenerate project files** after adding classes\u002Fmodules; add module deps in `*.Build.cs`\n  (missing `\"EnhancedInput\"`\u002F`\"UMG\"` = linker errors).\n- **Multiplayer**: replicate state with `UPROPERTY(Replicated)`, gate server actions behind\n  `HasAuthority()` → see `gamedev-multiplayer`.\n\n## Related skills\n\n- [`cpp`](..\u002Fcpp\u002FSKILL.md) — plain C++\u002FRAII\u002Fsmart-pointer ownership for **non-UObject** code; this\n  skill owns the Unreal reflection + GC model layered on top.\n- [`gamedev-shipping`](..\u002Fgamedev-shipping\u002FSKILL.md) — deep cooking\u002Fpackaging\u002Fstore submission.\n- [`gamedev-multiplayer`](..\u002Fgamedev-multiplayer\u002FSKILL.md) — replication, RPCs, authority.\n- [`gamedev-physics`](..\u002Fgamedev-physics\u002FSKILL.md) — Chaos physics, collision, constraints.\n- [`game-design`](..\u002Fgame-design\u002FSKILL.md) — mechanics\u002Floops before you build them.\n- [`godot`](..\u002Fgodot\u002FSKILL.md) \u002F [`unity`](..\u002Funity\u002FSKILL.md) — the other engines; route there\n  when the project is Godot or Unity, not Unreal.\n\n## Checklist\n\n- [ ] Correct base class chosen (Actor\u002FPawn\u002FCharacter; GameMode**Base** unless match-state needed).\n- [ ] No legacy input — Enhanced Input (`UInputAction` + `UInputMappingContext` + subsystem).\n- [ ] Every long-lived UObject\u002FActor ref is a `UPROPERTY() TObjectPtr\u003CT>` (GC-safe).\n- [ ] Components made in ctor via `CreateDefaultSubobject` + `SetupAttachment`; no logic in ctor.\n- [ ] Tick left off unless required; periodic work on a timer\u002Fevent.\n- [ ] C++↔BP boundary correct: `BlueprintCallable`\u002F`Pure` to expose, `BlueprintImplementableEvent`\u002F\n      `NativeEvent` for BP-overridable hooks; BP-bound delegates are dynamic multicast.\n- [ ] UI is UMG (`UUserWidget` + `BindWidget`), not HUD canvas drawing.\n- [ ] Server-only vs replicated state placed correctly (GameMode server-only).\n- [ ] Module deps (`EnhancedInput`\u002F`UMG`\u002F`Paper2D`) added in `*.Build.cs`; project files regenerated.\n",{"name":5,"tags":24,"origin":29,"profiles":30,"recommends":32,"description":7},[5,25,26,27,28],"ue5","blueprint","unreal-engine","gamedev","risco",[31],"full",[33,34,35,36,37,38,39],"cpp","gamedev-shipping","gamedev-multiplayer","game-design","gamedev-physics","godot","unity","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","06-前端与设计\u002Funreal",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill unreal",{"tool":54,"command":55},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill unreal",{"tool":57,"command":58},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill unreal","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Funreal\u002FSKILL.md",true,[62,68,72,76,80],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"evals\u002Fcases.yaml","REFERENCE","参考文档",4191,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Funreal\u002Fevals\u002Fcases.yaml",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"evals\u002FREADME.md",916,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Funreal\u002Fevals\u002FREADME.md",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fblueprint-cpp-parity.md",6045,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Funreal\u002Freferences\u002Fblueprint-cpp-parity.md",{"path":77,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fgameplay-framework.md",4915,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Funreal\u002Freferences\u002Fgameplay-framework.md",{"path":81,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fpackaging.md",3872,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Funreal\u002Freferences\u002Fpackaging.md",[85,92,97,104,111,118],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":93,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]