Creating a custom Actor in C++

While there are a number of different types of Actors that ship with Unreal as part of the default installation, you will find yourself needing to create custom Actors at some point during your project's development. This might happen when you need to add functionality to an existing class, combine Components in a combination not present in the default subclasses, or add additional member variables to a class. The next two recipes demonstrate how to use either composition or inheritance to customize Actors.

Getting ready

Make sure you have installed Visual Studio and Unreal 4 as per the recipe in Chapter 1, UE4 Development Tools. You'll also need to have either an existing project, or create a new one using the Unreal-provided ...

Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.