How to declare a Blueprint's Actor -> Object reference in C++

I want to declare the Trigger variable in C++:

I want to do the same but in C++. I have tried this:

private:	
	UPROPERTY(EditDefaultsOnly, Category = "Component")
	TSoftObjectPtr<class ADoorLever> DoorLever;

When I try to set a Blueprint class that inherits from ADoorLever C++ class in the Blueprint’s editor I get the error which I don’t understand:

Illegal TEXT reference to a private object in external package (BP_DoorLever_C /Game/MultiplayerTest/Maps/P_TestMap.P_TestMap:PersistentLevel.BP_DoorLever_C_UAID_FCAA149CCB50ED4401_1244687679) from referencer (BP_Door_2_C /Engine/Transient.World_17:PersistentLevel.BP_Door_2_C_0). Import failed…

How can I do it?

1 Like

Object reference is a reference to an object in the world. If you’re using ConstuctionHelpers to find your class in the library by the path, it’s not an object reference, but a class reference.
Please elaborate what exactly you need to do here.