How do we get a reference to BP for our C++ class?

So I want to know how I can get reference to a BP that inherits from my class. Say I have a ACharacterBP which inherits from a ACharacter C++ class. How would I get a reference to that ACharacterBP?

I know the following pieces of code might help, but I’m not sure how to distinguish between them and what each means or even if they’re the right code to use for getting a reference to a BP:

UPROPERY(EditAnywhere, BlueprintReadWrite, Category = "Hello")
class ACharacter* TheCharacterBP;

//OR

UPROPERY(EditAnywhere, BlueprintReadWrite,  Category = "Hello")
ACharacter* TheCharacterBP;

//OR

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hello")
TSubclassOf<class ACharacter> TheCharacterBP;

But why should I choose that over the other ones?

You want:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hello")
 TSubclassOf<class ACharacter> TheCharacterBP;

The “TSubclassOf” is the key to remember here.

Enjoy!

If your character exist, you normal get player character or get player pawn and cast it character or base C++ class of character you have. If it’s not exist use what Devero said and from that you can spawn character