Reputation: 4755
Unity's new "Prefab Variant" feature, introduced in 2018.3, is pretty sweet; you can learn more about it here.
I made some changes to an imported 3D model, preparing it for usage in my game, and then dragged the changed GameObject into the file area to save the prefab, when I was asked whether to save it as an original prefab or a prefab variant.
The first (original prefab) option basically removes ties to the source prefab (the 3D model), applying all overrides and setting it in stone. The latter (prefab variant) option still uses the 3D model prefab as it's imported, and applies all of the changes I've made as overrides atop that, meaning if I re-import the model, its new changes will propagate and the changes I'd made on the prefab variant would also still exist.
That sounds great! In fact, I can't think of any circumstance where I wouldn't want that. If I was changing the source prefab so much that the overrides became invalidated, then I'd need to redo work whether or not I used the prefab variant feature - no difference there.
Thus I can only think of benefits to using the prefab variant... Perhaps it's an overhead thing, but I don't know anything about that. I even get the feeling that there could be some performance benefits to using variants (deduplication of prefabs or something like that), but that's me just speculating.
Hence my question: when and why shouldn't I use the new prefab variant feature, and opt for original prefabs instead?
Upvotes: 3
Views: 3923
Reputation: 1712
Variants are great if you want several versions of the same base object. if you have more than one type of the same object you should always use them. the overhead is practically the same, but its a great orginizational feature! since its mainly to improve ease of use, for multiple objects as well as workflow, there is a major caveat to using it.
Dont use this feature if your disorganized. but wait, your going to use it, its just to great, having all those different prefabs ready at a moments notice! so heres the thing... if your making a new version of your base object, replace the base object... you dont want some to be a variant of the bas, and others the variant of a variant, keep it organized, and you will reap the rewards in the time-management are of your project!
Upvotes: 1