This code snippet:
static const FName MyProperty( TEXT("MyInt32Variable") );
UClass* MyClass = GetClass();
for( UProperty* Property = MyClass->PropertyLink; Property; Property = Property->PropertyLinkNext )
{
UIntProperty* IntProperty = Cast<UIntProperty>( Property );
if( IntProperty && Property->GetFName() == MyProperty )
{
// Need more work for arrays
int32 MyIntValue = IntProperty->GetPropertyValue( Property->ContainerPtrToValuePtr<int32>(this) );
UE_LOG( LogSteve, Log, TEXT("Value is = %i"), MyIntValue );
break;
}
}
will print a blueprint variable named “MyInt32Variable” that is of type Integer to the log in your class.
And it won’t have any compile time checking, so if you change your type or name of the variable, it won’t find it. So it’s very sensitive to changes in the blueprint.
Cheers,