UProperty in Unreal Engine C++



Exposes a variable to Unreal's reflection system

Syntax

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Custom Category")
bool MyProperty = false;

Edit* & Visible* Specifiers

// Allows property to be viewed/edited inside the details panel
EditAnywhere    | EditInstanceOnly    | EditDefaultsOnly
VisibleAnywhere | VisibleInstanceOnly | VisibleDefaultsOnly

Blueprint* Specifiers

// Allows property to be used inside Blueprint's Event Graph
BlueprintReadWrite | BlueprintReadOnly  

All Specifiers

EditAnywhere
EditInstanceOnly
EditDefaultsOnly

VisibleAnywhere
VisibleInstanceOnly
VisibleDefaultsOnly

BlueprintReadWrite
BlueprintReadOnly

Category = "My Category | My Sub Category"  // Allows property to be placed in the given category

Meta Specifiers

// Use Syntax UPROPERTY(meta=(...))

DisplayName = "My Property"  // Allows property name to be different inside editor

AllowPrivateAccess = "true"  // Allows property to be placed inside `private` Access Specifier of the class