Accessing variable from hit actors

You need to attempt to cast the actor to the subclass that has the variable, and if it works, access it through the casted pointer.

Typically, this is hard if your variable is defined in blueprint and you’re trying to do it from C++. You generally want to define everything in C++ that you want to access in C++, and only use Blueprint as “decoration” on top of the base C++ classes, if you do C++ development.

More information about casting in Unreal in C++: