mcpbeat Sign in

Unreal Cpp Gameplay Agent Skill

> the Gameplay Framework (GameMode, Pawn, Character, PlayerController, Actor components), and the module Build.cs. Use when writing or debugging UE C++, deriving from AActor/ACharacter/ AGameModeBase, exposing properties to the editor or Blueprints, or when the user mentions Unreal C++, UCLASS, GENERATED_BODY, GameMode, ACharacter, or .Build.cs.

3k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
401
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/gamedev-skills/awesome-gamedev-agent-skills --skill unreal-cpp-gameplay

The instruction itself

10 sections, as written by the author

Unreal C++ Gameplay

Write correct UE5 gameplay C++: the reflection macros that connect C++ to the editor and

Blueprints, the Gameplay Framework class roles, and module dependencies. Targets UE 5.4+.

When to use

  • Use when creating C++ gameplay classes (AActor, APawn, ACharacter, AGameModeBase,

UActorComponent), exposing properties/functions with UPROPERTY/UFUNCTION, setting up a

GameMode's default classes, or adding a module dependency in *.Build.cs.

  • Use when the project has a Source/ tree with *.h/*.cpp using UCLASS, and *.Build.cs.

When *not* to use: designer-facing visual logic → unreal-blueprints. Player input

binding details → unreal-enhanced-input. AI logic → unreal-behavior-trees. This skill owns

the C++ class/reflection foundation those build on.

Core workflow

  • Name with the right prefix. A = Actor-derived, U = UObject/component-derived,

F = plain struct, E = enum, I = interface. The prefix must match the base class.

  • Declare the class with reflection macros. UCLASS() above the class, GENERATED_BODY()

as the first line in the body, and #include "ClassName.generated.h" as the last

include in the header.

  • Expose data with UPROPERTY (editor/Blueprint visibility *and* garbage-collection

tracking) and behaviour with UFUNCTION (BlueprintCallable, etc.).

  • Create components in the constructor with CreateDefaultSubobject<T>(TEXT("Name")) and

set the RootComponent.

  • Know the framework roles: AGameModeBase sets the rules + default classes; APawn/

ACharacter is the controllable body; APlayerController is the player's will;

UActorComponent is reusable behaviour.

  • Add module dependencies to *.Build.cs (e.g. EnhancedInput) or unresolved-symbol

link errors follow.

  • Verify by compiling (Live Coding Ctrl+Alt+F11 for function bodies; full rebuild for

header/UPROPERTY changes) and checking the class/properties appear in the editor.

Patterns

1. Minimal Actor class (header + source)

// Pickup.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Pickup.generated.h"          // MUST be the last include

UCLASS()
class MYGAME_API APickup : public AActor   // MYGAME_API = your module's export macro
{
    GENERATED_BODY()
public:
    APickup();

    // EditAnywhere = tweak per-instance & on the CDO; BlueprintReadWrite = BP get/set.
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pickup")
    int32 ScoreValue = 10;

    // UPROPERTY on a UObject* pointer is what keeps it from being garbage-collected.
    UPROPERTY(VisibleAnywhere)
    TObjectPtr<UStaticMeshComponent> Mesh;   // UE5: TObjectPtr instead of raw UStaticMeshComponent*

    UFUNCTION(BlueprintCallable, Category = "Pickup")
    void Collect();

protected:
    virtual void BeginPlay() override;
};
// Pickup.cpp
#include "Pickup.h"
#include "Components/StaticMeshComponent.h"

APickup::APickup()
{
    Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));
    RootComponent = Mesh;                     // the mesh is this actor's root
}

void APickup::BeginPlay() { Super::BeginPlay(); }   // always call Super
void APickup::Collect()   { Destroy(); }

2. GameMode wiring its default classes

// MyGameMode.cpp — set in the constructor so the engine spawns your classes.
AMyGameMode::AMyGameMode()
{
    DefaultPawnClass      = AMyCharacter::StaticClass();
    PlayerControllerClass = AMyPlayerController::StaticClass();
}

3. Module dependency in Build.cs

// MyGame.Build.cs
PublicDependencyModuleNames.AddRange(new string[]
{
    "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput"
});

Pitfalls

  • generated.h not last / missing — compile errors like "Cannot find generated header" or

"Expected an include". It must be the final include in the header.

  • Forgetting GENERATED_BODY() — UHT (Unreal Header Tool) errors; it must be the first

thing inside the class body.

  • Raw UObject* without UPROPERTY — the garbage collector doesn't see it and may destroy

it out from under you. Track every UObject pointer with UPROPERTY (use TObjectPtr in UE5).

  • Header/UPROPERTY edits with Live Coding — Live Coding handles function bodies, but

changes to UCLASS/UPROPERTY/headers need a full editor restart + rebuild.

  • Wrong class prefix — naming an Actor UFoo (or a component AFoo) breaks UHT; match the

prefix to the base type.

  • Unresolved external symbol at link — the module providing the API isn't in Build.cs

PublicDependencyModuleNames.

  • Not calling Super:: in overridden BeginPlay/Tick/etc. skips engine setup.

References

  • For UActorComponent creation/attachment, the UPROPERTY garbage-collection ownership rules

(TObjectPtr, TArray<TObjectPtr<>>, AddToRoot), and a replication primer, read

references/components-and-gc.md.

  • Primary docs: "Unreal Engine CPP Quick Start" and "Gameplay Framework"

(https://dev.epicgames.com/documentation/en-us/unreal-engine/gameplay-framework-in-unreal-engine).

  • unreal-blueprints — exposing C++ to designers; BP/C++ interop.
  • unreal-enhanced-input — binding input in a C++ Pawn/Character.
  • unreal-behavior-trees — C++ AI tasks driven from a behaviour tree.

Other skills for the same job

different authors, same section of the catalogue
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Codex
by softaworks
×2

Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing. Uses GPT-5.2 by default for state-of-the-art software engineering.

2k tokens
Memory Safety Patterns
by ComeOnOliver
×2

Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, managing resources, or preventing memory bugs.

6k tokens
Pysam
by K-Dense-AI
×1

Python/HTSlib workflows for genomic files. Use when reading, querying, filtering, or writing SAM/BAM/CRAM, VCF/BCF, FASTA/FASTQ, or tabix data with pysam, including pileup, coverage, indexing, and CRAM references.

34k tokens scripts
Scientific Critical Thinking
by K-Dense-AI
×1

Evaluate scientific claims and evidence quality. Use for assessing experimental design validity, identifying biases and confounders, applying evidence grading frameworks (GRADE, Cochrane Risk of Bias), or teaching critical analysis. Best for understanding evidence quality, identifying flaws. For formal peer review writing use peer-review.

26k tokens
Gh Fix CI
by openai
vendor ×1

Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.

8k tokens scripts
Declarative Agent Developer
by microsoft
vendor ×1

> Create, build, deploy, and localize declarative agents for M365 Copilot and Teams. USE THIS SKILL for ANY task involving a declarative agent — including localization, scaffolding, editing manifests, adding capabilities, and deploying. Localization requires tokenized manifests and language files that only this skill knows how to produce. "scaffold an agent", "new agent project", "add a capability", "add a plugin", "configure my agent", "deploy my agent", "fix my agent manifest", "edit my agent", "localize my agent", "add localization", "translate my agent", "multi-language agent", "add an API plugin", "add an MCP plugin", "add OAuth to my plugin", "review instructions", "improve instructions", "fix my instructions"

66k tokens
Documentation
by lingxling
×1

Documentation generation workflow covering API docs, architecture docs, README files, code comments, and technical writing.

1k tokens

How to use it

Copy the folder

Take gamedev-skills/unreal-cpp-gameplay from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.