Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
We create a new Actor based on StaticMeshActor for easy access to a visual representation via the Static Mesh.
UPROPERTY is added to give us a property to change, which causes PostEditChangeProperty events to be triggered.
PostEditChangeProperty is a virtual function that's defined in Actor.
As a result, we override the function in our class.
Within our class constructor, we initialize our mesh as usual, and set the default state of our bool property to match the visibility of the component it controls.
Inside PostEditChangeProperty, we first check that the property is valid.
Assuming it is, we retrieve the name of the property using GetFName().
FNames are stored internally by the engine as a table of unique values.
Next, ...
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