Programming Documentation

logo

Programming Documentation

Search
Light Mode
Contact Us

Contact us

No results for your search.
Sorry, an unexpected error occurred

A prefab variant is essentially a copy of an original prefab, but with a list of overrides stored in the prefab file itself.


Prefab instances in a scene can have overrides. If you drag a prefab with some overrides into the project's folders, Unity can create a prefab variant with those overrides. In the example below, the prefab variant file is open, but it still has a list of overrides.


There is a parent child relationship. The prefab variant is the child and inherits every detail of the parent prefab. If you change something in the parent prefab, the child prefab will inherit the modified parent prefab.


Prefab Variants in Sky Jellies

One use for prefab variants will be the Jellies. In Sky Jellies, there will be many different Jellies. There is a lot that will be the same because they are all Jellies but, they all will all have different personalities, traits, and abilities.


We want the core functionality to be the same but we want them all to be unique as well. So prefab variants will make that process easier for the whole team.


Depending on how things work out, we might use a mix of prefab variants, nested prefabs, and animator override controllers. Like with code, the main thing is to follow the DRY principle, don't repeat yourself.

On This Page