Advantages of using Prefab variants?

Hi there GameDevTV Community,

I’ve just completed watching the video and was wondering what kind of advantages the prefab variant workflow offers over simply creating non-variant prefabs of each tile needed for this game?

It seems to me that using prefab variants introduces unnecessary complexity in managing your project assets and can increase the likelihood of development mistakes? Admittedly, I don’t have a lot of experience in using prefab variants and have always created a root/base (non-variant) prefab for each type of GameObject in my projects, even when there are subtle differences (like a rotation) between them.

From my experience with learning Unity and C#, advantages are not always apparent when learning new workflows, concepts or syntax so any thoughts, lessons learned, or discussion is very much appreciated.

Thanks!

Prefab variants allow us to create ‘templates’ of objects. If we have several types of doors, we create a single prefab with all the door functionality that is common to doors. Then we make variants and they all already have that functionality, all we need to do is add the differences. If we make a change that should affect all doors, we only need to make this change in the root prefab. If we have non-variant versions, we’d need to go to each one of the doors and make the same change in all of those individually. This is more prone to mistakes

Ah that makes sense!

I hadn’t considered the flexibility that variants offer when choosing whether an alteration should affect all instances of a prefab or just a few.

Thanks for your reply!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms