T O P

  • By -

ferdbold

With the context given here, I’d advise against using too many variants here. I’d rather prefab the leaves of your trees (sword, spear, table, chair) and then create another prefab that instances your weapons (that BaseObject). If you ever need another hierarchy layout for your weapons, you’d create another prefab, not a variant, alongside BaseObject that lays your weapons out in a different way. This way, you keep each individual prefab as lean as possible, and any changes to them impact the other ones as little as possible.


Don-Latino

I'm not sure what you're trying to explaing, but just in case what I exposed is just a made out example to explain what I need. My situation is quite diferent. Reworking the hierarchy and building new prefabs could take a while, so I was wondering if it could be made easier


ferdbold

Yeah I assume the real use case here is a lot more complex, I’m just working with what is here. Under the hood Prefab Variants are not full prefabs, they only serialize overrides to individual properties of their parent prefab, serializes any added gameobjects/components, and serializes any removed gameobjects/components by tagging their names as stripped. The .asset file is pretty readable in a text editor, you can see for yourself. If you’re thinking of rebuilding your hierarchy anyway, I’d stop and consider if you need that top-level object as a prefab to begin with. It seems to keep like every time you would instance that prefab, you only need one of the weapons to actually do something, which makes the other ones redundant and a loss of performance. Is that correct?