While this book focuses on C++, when developing with Unreal, a more standard workflow is to implement core gameplay functionality as well as performance-critical code in C++, and expose those features to Blueprint to allow designers to prototype gameplay, which can then be refactored by programmers with additional Blueprint features, or pushed back down to the C++ layer.
One of the most common tasks, then, is to mark up our classes and structs in such a way that they are visible to the Blueprint system.
Create a new
Actor
class using the editor wizard; call itBaseEnemy
.Add the following
UPROPERTY
to the class:UPROPERTY() FString WeaponName; UPROPERTY() int32 MaximumHealth;
Add the following class specifier to the
UCLASS
macro:UCLASS(Blueprintable) class UE4COOKBOOK_API ABaseEnemy : public AActor
Open the editor and create a new blueprint class. Expand the list to show all classes and select our
BaseEnemyclass
as the...