Set member variables (C++ class) in Default Value section of Details View

Hi. I have a (quite basic) question. I have a C++ class that is derived from UObject that looks like this:

UCLASS(Blueprintable, BlueprintType)
class TESTGAME_API UTestClass: public UObject
{
	GENERATED_BODY()

public:
	UTestClass();
	~UTestClass();

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	int TestValue;
};

Now one of my Blueprints has a Blueprint Variable of UTestClass. I want to set a default value for TestValue via BP in the Details Window resp. in the Default Value section, but I don’t see it. How can I expose a member variable of a C++ class to BP so that I can set it via Default Value?

283143-defaultvalue.png

Thus I want to have something similar like shown on this image (random find):

283144-reference.png

You can’t with normal pointers, because object need to be guaranty to exist. Only exceptions are assets which are also UObjects and if you do that your blueprint or asset type will be hard reference to the setted asset. Also when you put actor on level you can refrence other objects on the level in property editor, similar to level blueprint.

You can do this with soft pointers, which are refrence to object that may or not exist and there existence can be checked, you can check. you can read about them here:

It’s not just assets but also objects on the level.

Normally you should search for object or make object register it self to other object that is easier to get point to (like GameMode or PlayerController). 2nd method is the best as it should not take much performance and referencing is the strongest this way. Other option is to make your own AWorldSettings where you can add extra properties in World Settings which will be saved with level and can be read out from UWorld, you set AWorldSettings class in project settings. this way reference is tied with level containing object you want