How to access pure blueprint actor in c++?

Hi, I’m trying to get a reference of blueprint actor in scene at runtime.

get all of class in c++ seems fine for me but,

I can’t tell this function the class type of pure blue print actor.

if the actor were made in c++ and instanced into blueprint actor, it works fine.
because i can put c++ header name of the actor as class type

but what if the actor were made in blueprint so c++ doesn’t have any clue about class type?

There must be a way to create a C++ interface and expose its functions to blueprints. Here’s a thread on this, but I don’t entirely understand it, maybe you will: How do i expose a C++ Interface to Blueprints with a BlueprintCallable function? - UI - Unreal Engine Forums

If you manage to expose interface functions to the pure BP, you can then call them in C++.

sweet!, i made the pure BP actor parent c++class actor and made BP functions into blueprintnativeevent. now i can get a reference of it in C++.
Thanks!

There’s probably several ways you can do that, but indeed you will have limited access to any custom functions and members from C++. You could always cache a reference to your Blueprint object somewhere easily accessible, like a gamemode for example. The type of that cached pointer would need to be something very generic, like AActor or UActorComponent or UObject. Some default UE type basically, so your C++ can read it. But indeed you would need some sort of interface or parenting to some other custom-made native C++ class for additional functionality