Casting UStruct to derrived struct

Your example doesn’t make any sense. StaticStruct is a static function and isn’t something that you should call on an instance like that. You’d call it on FActorRecord or FRecord instead which would always give you the right thing. I’m surprised the syntax even works.

The same is true of UObjects and calling StaticClass. The only difference is that UObjects also have a member function that you can call on an instance, GetClass, which returns the actual type. In fact, if you called StaticClass on UObject instances like you are with your example you’ll get the “wrong” behavior there too (because that’s not how StaticClass or StaticStruct are supposed to work).

But all of this is sort of moot since you’re not supposed to use structs polymorphically in Unreal.