Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
Inside BeginPlay, we create an empty FTransform object, which has the default value of 0 for all translation and rotation components, so we don't need to explicitly set any of them.
We then use the SpawnActor function from UWorld so that we can create an instance of our SingleActorInterface, storing the pointer to the instance into a temporary variable.
We then use GetClass() on our instance to get a reference to its associated UClass. We need a reference to UClass because that object is the one that holds all of the reflection data for the object.
Reflection data includes the names and types of all UPROPERTY on the object, the inheritance hierarchy for the object, and a list of all the interfaces that it implements.
As a ...
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