How to create Variants of UObjects - Need ideas

So, Unreal doesn’t really have any notion of data-inheritance that allows for that sort of thing between instances. However, I’m not really sure you need that anyway. It sounds like you just need to use blueprints.

For example: Let’s say you’ve got a C++ class for a unit. This would be any old unit. Then you could make a blueprint of that class for an enemy Skeleton and configure all the values that make it that sort of enemy. From there you could make a blueprint of Elite Skeleton that changes just the health to be larger. All the other values would be used from the Skeleton blueprint and if you changed Skeleton, Elite Skeleton would automatically get those values.

Ultimately this is the same as c++ inheritance, but shifts it all into content for easier configuration. It also keeps them opaque to code so that there is no lure to trying to cast to the derived types in ways you shouldn’t.

If that’s not sufficient I’d have to hear more about your particular use case. At my work we were able to solve nearly all our data-inheritance needs through a few strategic blueprints.

1 Like