Hi.
I am trying to read the variable values from different blueprint components and while I was able to find how to do that for some variable types like float, double, bool and int I am not able to figure out how to do it for anything else. For example variables of type FVector, FRotator or any type of struct/enum/class. So how do I get the variable values for lets say a FVector, and do the other types work the same way?
I found that a FVector is a UStructProperty but I cant manage to access the vectors x, y, and z.
The following example is part of the code I have now where I successfully find bool and float values.
UCharacterMovementComponent *c = Cast<UCharacterMovementComponent>(Component);
if (c != NULL)
{
for (TFieldIterator<UProperty> PropIt(c->GetClass()); PropIt; ++PropIt)
{
if (PropIt->IsA(UBoolProperty::StaticClass()))
{
UBoolProperty *BoolProp = CastChecked<UBoolProperty>(*PropIt);
bool CurValue = BoolProp->GetPropertyValue_InContainer(c);
}
else if (PropIt->IsA(UFloatProperty::StaticClass()))
{
UFloatProperty *NumericProp = CastChecked<UFloatProperty>(*PropIt);
float CurValue = NumericProp->GetPropertyValue_InContainer(c);
}
else if (PropIt->IsA(UStructProperty::StaticClass()))
{
UStructProperty *StructProp = CastChecked<UStructProperty>(*PropIt);
// find values for FVector, FRotator, and so on
}
}
}
I should also point out that I will use this for a plugin so I have to find the properties from existing blueprints. So creating my own c++ class and use that when creating the blueprints is not an option.
Thanks in advance.