0
Under Review

Prefab Variants losing data

laalami 2 weeks ago • updated by Lazlo Bonin (Lead Developer) 2 weeks ago 1

Hi Lazlo,

Got an issue with prefabs losing data as well (2018.3.5f1 and bolt 1.4.1) but with prefab variant specifically.

Reprosteps:
1/ Create a new prefab
2/ Add a flow machine from a macro and fill some variables
3/ Create a prefab variant
4/ Open the prefab variant in prefab mode and change the variables values
5/ Save changes in prefab variant

Current behavior:

The variables and macro are removed from the prefab variant.

Expected behavior:

Variables and macro should be saved in the prefab variant.

Data and flow machine are missing from the instantiated prefab variant in Play mode.
When in PrefabMode, variables and flow machine are missing in the variants. Reverting component to the prefab variant is not saved (see video and yes I save the prefab before switching ;)

BoltPrefabVariant.mp4

I tried changing non-bolt component (Tint on the sprite renderer) and that works just fine :(

Let me know if you can't reproduce this one and I will try to reproduce it in a new project.
Project was started in 2018.2 but has been running with 2018.3 since November.

UPDATE: I copied my project in a different folder and updated it to 1.4.3 and the issue still occurs. I also made sure I was working from a newly created prefab and updated the reprosteps above.

WORKAROUND: I use regular prefabs instead of prefab variant for now but I planned to use that for 100+ abilities and I will need prefab variant at some point.

Bolt Version:
1.4.1
Unity Version:
2018.3.5f1
.NET Version:
Under Review

Hi Islaami,

Thanks for the report, I'm sorry you're experiencing this issue. (I split your comment into a separate thread because it is related to Prefab Variants, not Nested Prefabs.)

To be very honest, the underlying serialization engine in Bolt 1, FullSerializer, was created years before the new prefab workflow was released and never maintained after that. For a myriad of reasons, this makes it very unstable with the new prefab workflow.

In Bolt 2, we're switching to Odin Serializer by Sirenix, which is very actively developed with prefab support in mind. By then, nested prefabs and prefab variants should be fully supported.

However, at the moment, I have to weigh whether it's worth spending days (if not weeks) of work on fixing FullSerializer for Bolt 1, which is going to be deprecated eventually anyway. Currently, I'm leaning towards using that time on releasing Bolt 2 faster instead. I'll update this thread if ever my planning changes on this. I hope you understand!