How do you downcast a UScriptStruct* in BP?

I have a UScriptStruct* field on a UCLASS object defined in C++. The value of this field is known at Blueprint-compilation time. I would like to downcast the value of this field to the actual USTRUCT that is stored in the field, so that I can access the struct-specific properties in Blueprints, the way structs are usually used in Blueprints.

However, I am having trouble doing this. I am capable of writing the C++ code to do something similar, for example, to set values on the base struct, by using

uint8* StructData = (*Prop)->ContainerPtrToValuePtr<uint8>((void*)Struct, 0);
CastFieldChecked<FIntProperty>(*Prop)->SetNumericPropertyValueFromString(StructData , TEXT("123"));

Where Prop is a FProperty on the derived Struct, and Struct is a UScriptStruct*. However, I am not sure how to accomplish this kind of FProperty access in Blueprints. The only solution I am coming up with is to somehow downcast the UScriptStruct* in BP, and then access the properties. But I am struggling to come up with the technique.

1 Like

I don’t think this is something you’ll be able to do in BP, nor would it be advised.
It would be better to just expose useful functions to BP that can be called to accomplish a more high level task.