Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
As usual, we create some tagged UPROPERTY Components for our actor. In this case, we added an additional parameter to the tag called VisibleAnywhere, so that we can see our variables within the Details tab. We create two Scene Components and two Static Mesh components.
In the constructor, we create default subobjects for each component, as usual.
We then load the static mesh, and if loading is successful, assign it to the two static mesh components so that they have a visual representation.
We then construct a hierarchy within our Actor by attaching components.
We set the first Scene Component as the Actor root. This component will determine the transformations that are applied to all other components in the hierarchy.
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