Editing class properties in different places in the editor
When developing with Unreal, it is common for programmers to implement properties on Actors or other objects in C++, and make them visible to the editor for designer use. However, sometimes it makes sense to view a property, or to make it editable, but only on the object's default state. Sometimes the property should only be modifiable at runtime with the default specified in C++. Fortunately, there are some specifiers that can help us restrict when a property is available.
How to do it…
- Create a new
Actor
class in the editor calledPropertySpecifierActor
. - Add the following property definitions to the class:
UPROPERTY(EditDefaultsOnly) bool EditDefaultsOnly; UPROPERTY(EditInstanceOnly) bool ...
Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.