There are 2 options:
-
The simplest is to create a C++ base class, add the variables to that, and then create the BP derived from that class. That makes them very easy to access from C++. You will need to mark the variables in the header like this:
UPROPERTY(BlueprintReadWrite, Category=MyCharacter)
float MyFloat; -
It is possible to find a property by name and then access its value like this:
UFloatProperty* FloatProp = FindField(Object->GetClass(), PropertyName);
if(FloatProp != NULL)
{
float* FloatPtr = FloatProp->GetPropertyValue_InContainer(Object);
if(FloatPtr != NULL)
{
float MyFloat = *FloatPtr;
}
}