Introduction
When I started with Unreal Engine 5, I found the idea of coding directly in C++ a little intimidating. Most tutorials focus on Blueprints, but I wanted to dive deeper into the engine’s core systems. This post is both my notes and a guide for anyone starting their Unreal C++ journey. We’ll create a new C++ project, look at the default setup, and write our very first line of Unreal C++ code.
Prerequisites
Before we start, make sure you have:
Unreal Engine 5 (latest version) installed.
When I started with Unreal Engine 5, I found the idea of coding directly in C++ a little intimidating. Most tutorials focus on Blueprints, but I wanted to dive deeper into the engine’s core systems. This post is both my notes and a guide for anyone starting their Unreal C++ journey. We’ll create a new C++ project, look at the default setup, and write our very first line of Unreal C++ code.
Prerequisites
Before we start, make sure you have:
Unreal Engine 5 (latest version) installed.
Visual Studio (Windows) or Rider for Unreal (cross-platform).
Basic understanding of C++ (helpful but not required—you can pick it up as we go).
Step 1: Create a New C++ Project
Open the Epic Games Launcher and click Unreal Engine → Launch.
Select Games and then click Next.
Choose a template (e.g., “Third Person”) → Click Next.
Under Project Type, select C++ instead of Blueprints.
Give it a name (e.g., UE5CPPStarter) and click Create.
At this point, Unreal will generate both the engine files and C++ classes for you.
Step 2: Explore the Default Classes
When the project opens, you’ll see some automatically generated code:
GameModeBase → Controls the game rules.
Character / Pawn → Represents players or controllable actors.
PlayerController → Handles player input.
These are the building blocks of every Unreal C++ project. Don’t worry if they feel abstract—we’ll use them often.
Step 3: Write Your First Unreal C++ Code
Let’s add a simple log message. Open any C++ class (e.g., YourProjectCharacter.cpp) and add this inside BeginPlay():
void AYourProjectCharacter::BeginPlay()
{
Super::BeginPlay();
// Print a message to the Output Log when the game starts
UE_LOG(LogTemp, Warning, TEXT("Hello Unreal from C++!"));
}
Now press Play in the Unreal Editor.
Open the Output Log (Window → Developer Tools → Output Log), and you’ll see your message printed.
Step 4: Run and Test
If everything is set up correctly, you should see:
LogTemp: Warning: Hello Unreal from C++!
Congratulations! You’ve just written and run your first Unreal Engine 5 C++ code.
Common Errors (and Fixes)
Visual Studio not showing Unreal symbols? → Make sure you installed “Game Development with C++” workload.
Hot reload fails? → Close Unreal, build the solution in Visual Studio, and reopen.
No Output Log? → Enable it from Window → Developer Tools → Output Log.
Conclusion
We now have a working Unreal Engine 5 C++ project and successfully ran our first log statement. This may seem small, but it’s a critical first step toward building gameplay systems.
In my next post, I’ll dive into Player Input in Unreal C++, where we’ll map keys and make our character move.
What was the biggest challenge you faced when starting with Unreal C++? Share your thoughts in the comments—I’d love to learn from your experience too!
Top comments (0)