unreal-cpp-gameplay
БесплатноБез исполняемых скриптовНе проверенUnreal Engine 5 (UE 5.8) C++ gameplay code: UCLASS and UPROPERTY reflection, the Gameplay Framework, GC-safe pointers, Build.cs and command-line builds. Use…
от gamedev-skills★ 12 656 звёзд на GitHubОб этом скилле
Unreal C++ Gameplay
Write UE5 gameplay C++ that compiles the first time, survives garbage collection and is testable from a terminal. Targets UE 5.8.
When to use
- Creating or fixing C++ gameplay classes (
AActor,APawn,ACharacter,AGameModeBase,UActorComponent), reflection macros, or a module's*.Build.cs. - Diagnosing compile, UHT, linker or Live Coding problems, and crashes from freed
UObjects. - Writing C++ automation tests and running them headless.
When not to use: designer-facing visual logic → unreal-blueprints. Input assets and
bindings → unreal-enhanced-input. Behavior Trees and EQS → unreal-behavior-trees. Cooking
and packaging → unreal-packaging. Building Unreal Engine itself from source is not covered;
follow Epic's source-build instructions for the engine's GitHub repository.
Workflow
- Read the project.
EngineAssociationin the.uprojectgives the engine version; theModuleslist andSource/<Module>/<Module>.Build.csgive module names and dependencies; existing base classes inSource/tell you what to extend. Match the existing API macro (MYGAME_API) and folder layout (Public/,Private/). - Declare reflected types correctly. The prefix matches the base (
Aactors,UotherUObjects and components,Fstructs,Eenums,Iinterfaces).GENERATED_BODY()is the first line in the body and#include "Name.generated.h"is the last include. - Make every
UObjectpointer GC-visible. Members that hold aUObjectareUPROPERTY()withTObjectPtr<T>; non-owning references areTWeakObjectPtr<T>. This is the most common source of random crashes. - Create default components in the constructor with
CreateDefaultSubobject, attach withSetupAttachment, and setRootComponent. Runtime components useNewObjectplusRegisterComponent. - Put logic where the framework expects it. Rules and default classes in the GameMode (server only), per-player state in PlayerState, input and UI ownership in the PlayerController, the body in the Pawn or Character, reusable behavior in components.
- Add module dependencies to
PublicDependencyModuleNames(orPrivate...when only the.cppfiles use them) whenever you include another module's headers, for exampleEnhancedInput,AIModule,Niagara,UMG. - Build and test from the command line (see Verify). Use Live Coding (Ctrl+Alt+F11) only for function-body edits while the editor is open.
Patterns
Reflected actor with a GC-safe component
// Pickup.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Pickup.generated.h" // last include
UCLASS()
class MYGAME_API APickup : public AActor
{
GENERATED_BODY()
public:
APickup();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pickup")
int32 ScoreValue = 10;
UFUNCTION(BlueprintCallable, Category = "Pickup")
void Collect();
protected:
UPROPERTY(VisibleAnywhere)
TObjectPtr<UStaticMeshComponent> Mesh; // UPROPERTY keeps it alive and visible to the editor
};
A C++ automation test
// Source/MyGame/Private/Tests/ScoreTests.cpp
#include "Misc/AutomationTest.h"
#if WITH_DEV_AUTOMATION_TESTS
IMPLEMENT_SIMPLE_AUTOMATION_TEST(FScoreAddsTest, "MyGame.Score.Adds",
EAutomationTestFlags::EditorContext | EAutomationTestFlags::ProductFilter)
bool FScoreAddsTest::RunTest(const FString& Parameters)
{
FScoreBoard Board; // plain logic: no world needed
Board.Add(10);
TestEqual(TEXT("score after one add"), Board.Total(), 10);
return true; // failed Test* calls still mark the test failed
}
#endif
Keep testable rules in plain structs or functions so most tests need no world; use functional tests in a test map for behavior that needs actors.
Verify
Say which of these you ran and paste the relevant result lines; "it should compile" is not a check.
- Compile the editor target with the editor closed:
Engine/Build/BatchFiles/Build.bat <Project>Editor Win64 Development -Project="<abs path>.uproject" -WaitMutex(Linux:Engine/Build/BatchFiles/Linux/Build.sh <Project>Editor Linux Development ...; macOS:Engine/Build/BatchFiles/Mac/Build.sh <Project>Editor Mac Development ...). Fix every error and every warning in files you touched. - Run the tests headless:
UnrealEditor-Cmd <Project>.uproject -ExecCmds="Automation RunTest MyGame;Quit" -unattended -nullrhi -nosplash -ReportExportPath="<dir>".RunTesttakes a full name, a dotted prefix,Test1+Test2, orGroup:<name>. Read the JSON report or theTest Completedlines in the log, and confirm the expected tests ran: a wrong filter runs nothing and still looks clean. - When behavior needs a person, ask the user to open the editor, check that the new class and its properties appear, run PIE, and re
Установить unreal-cpp-gameplay в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл unreal-cpp-gameplay?
Unreal Engine 5 (UE 5.8) C++ gameplay code: UCLASS and UPROPERTY reflection, the Gameplay Framework, GC-safe pointers, Build.cs and command-line builds. Use for GENERATED_BODY, Live Coding, "unresolved external symbol" or UHT errors. Not for Blueprints (`unreal-blueprints`), Enhanced Input (`unreal-enhanced-input`) or packaging (`unreal-packaging`); engine source builds are out of scope.
Как установить скилл unreal-cpp-gameplay?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл unreal-cpp-gameplay запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic