Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
As always, we first declare a UPROPERTY to hold a reference to our component subobject. We then create two UFUNCTION declarations. These are marked as virtual and override so that the compiler understands that we want to replace the parent implementation, and that our function implementations can be replaced in turn.
In the constructor for the object, we create the subobject using the CreateDefaultSubobject function. Afterwards, we set the extents (size) of the box via the SetBoxExtent function using a FVector holding the X, Y, and Z sizes we want the box to have, respectively.
In the implementation of the functions, we create an FString from some preset text and substitute some data parameters using the FString::Printf function. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access