How to expose and editable a variable in C++?

Hi, How to expose on spawn and instance editable a variable in C++ ?

Currently I am trying this: but not sure if this is the right way.

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Position", ExposeOnSpawn = "true", OverrideNativeName = "bOnHand"))
bool bOnHand;

" ExposeOnSpawn="true"" is meta data for a property which means it must be wrapped in the meta specifier:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Position", meta = (ExposeOnSpawn = "true", OverrideNativeName = "bOnHand"))
bool bOnHand;

Probably same for OverrideNativeName . I can’t find OverrideNativeName in the documentation but it is in the engine source code as far as I can see.

Metadata Specifiers

5 Likes

Thank You Sir very much for explaining with details , it was very nice to read and learn :slight_smile: