Quick Start - your first actor in 3 minutes
This guide gets a real generated C++ actor into your project. No knowledge of Unreal C++ required.
1. Create your first .tps file
In your project root, find (or create) the TPScripts/ folder. Create a file named first_hero.tps:
// first_hero.tps - a low-level TPScript actor
uclass AFirstHero : AActor meta: api=TPSGENERATED_API
{
prop public float Health EditAnywhere BlueprintReadWrite category="Hero" default=100.0f
method public virtual void BeginPlay() override {
Super::BeginPlay();
UE_LOG(LogTemp, Warning, TEXT("AFirstHero spawned with %f health"), Health);
}
method public virtual void Tick(float DeltaTime) override {
Super::Tick(DeltaTime);
}
}
2. Open the TPScript panel
Go to Tools → TPScript → Open TPScript Panel (or click the TPScript button in the Play toolbar).
The panel has three tabs: Edit, Examples, and Docs.
- Edit lists your modules and their
.tpsfiles. - Examples bundles 15 teaching files you can open.
- Docs renders the built-in markdown reference.
Your first_hero.tps should appear under the TpsGenerated module (or your own module).
3. Regenerate
Click Regenerate All (or Regen This File if you only want to rebuild first_hero.tps).
The Output Log will report each file's status:
[NEW] Public/Hero/AFirstHero.h
[NEW] Private/Hero/AFirstHero.cpp
If your project module didn't exist yet, the regenerator creates the module boilerplate (<Module>.Build.cs, header, and cpp) automatically.
4. Compile
Click Compile in the panel (after regen), or press Ctrl+Alt+F11 for Live Coding, or build the Editor target from your IDE.
The generated code is real UHT-compatible C++ - Unreal compiles AFirstHero like any other actor class.
5. Use it
- Spawn it from a Blueprint, another actor, or a spawn volume.
- Set
Healthin the Details panel (it'sEditAnywhere). - Read/write
Healthfrom any Blueprint (it'sBlueprintReadWrite). - Watch the log message print when the actor spawns.
That's it. You've written a gameplay mechanic in a few lines of TPScript and gotten real C++ with full Blueprint integration in return.
Trying without a module
If you just want to explore before wiring up your own module, open the Examples tab in the panel, double-click 01-hello-actor.tps, and hit Regen This File. The demo module compiles it immediately.