How to reference one blueprint from another?

I am writing an Actor class in C++.

I have created a blueprint class that derives from this Actor class.

I want to be able to reference some other blueprint class from within my Actor blueprint (so I can spawn it through code), but when I create a UProperty it only seems to be letting me select from Actors that are in the currently opened map.

I want a reference to a non-scene object.

Example code:

class AMyActorClass : public AActor
{
    UPROPERTY(EditAnywhere)
    AActor* ReferencedActor;
}

In the above example, When I go to edit the blueprint class and try to assign some other blueprint to ReferencedActor, I am unable to select anything other than Actors in the currently loaded map.

Thank you very much. That’s exactly what I needed.

Hey here, so you want to be able to select a type of an actor and not an instance correct? if that is the case you can do this:

UPROPERTY(EditAnywhere, Category = "Test")
TSubclassOf<AActor> ActorClass; // You can specify whatever type you want and it will filter the dropdown options

This will create a dropdown where you can select from all of the child classes of the class you specified. Then you just use the variable itself like it’s an UClass for the SpawnActor, for example.