Serialize a polymorphic type of struct

take a look at this, pretty amazing article Polymorphic Serialization In Unreal Engine - slowburn.dev