The specifiers mentioned in the previous recipe are all well and good, but they only control the visibility of UPROPERTY
in the Details panel. By default, even with those specifiers used appropriately, UPROPERTY
won't be viewable or accessible in the actual editor graph for use at runtime.
Other specifiers, which can optionally be used in conjunction with the ones in the previous recipe, can be used to allow interacting with properties in the Event Graph.
Create a new
Actor
class calledBlueprintPropertyActor
using the editor wizard.Add the following
UPROPERTY
to the actor using Visual Studio:UPROPERTY(BlueprintReadWrite, Category = Cookbook) bool ReadWriteProperty; UPROPERTY(BlueprintReadOnly, Category = Cookbook) bool ReadOnlyProperty;
Compile your project, and start the editor.
Create a Blueprint class based on your
BlueprintPropertyActor,
and open its graph.Verify that the properties are visible under the category Cookbook...