Setting AActor in blueprint class copied from c++ class

I created BP class from c++ class and i can’t assing Specific Actor . i can open menu in blueprint editor but it is always set to none. i don’t know what to do.
i done this becose i wanted to spawn actor with mesh and logic but i need to set this property.


UPROPERTY(EditAnywhere, /BlueprintReadWrite/)
class AActor* SpecificActor;
edit : i found log :
LogProperty: Warning: Illegal TEXT reference to a private object in external package (PicUpStar /Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap.ThirdPersonExampleMap:PersistentLevel.PicUpStar_1) from referencer (MyPicUpStar_bp_C /Game/BP/MyPicUpStar_bp.Default__MyPicUpStar_bp_C). Import failed…

In default properties you can not set object (as this is not just actors) outside of those in asset registry (what you see in content browser) and object created by reflection system (UClass etc). As a class of a object that yet to be created, UE4 can’t assure that object will exist on spawn, as you can spawn this actor in level that that actor don’t exist. You can only do that when you place actor on the level in editor and in detail then you can pick other actor that is on the level as they co-exist on same level and there existence can be assured on load. Same goes with level blueprint which also i technically part of level.

You can not do that with dynamic spawned actors, you can only set UClass* (or TSubclassOf) of object that you want to create or search for. Best practice is to keep reference of spawned objects or if actor is spawned by more classes, actor to register it self to more global easy to get actor like GameMode and actor optionally can inform other actors that actor appeared and they can keep reference and start communicating with it. Last resort is to use actor iterators or “Get All Actors Of XXX” nodes to get reference of other actor, but they expensive operation aspecially if your level has lot of actors.