Cannot Fix

Prefab Variants losing data

laalami 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 2

Hi Lazlo,

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

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 ;)


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:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
Satisfaction mark by laalami 2 years ago
Pending 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!

Cannot Fix

Closing this. My ultimate decision was to focus on Bolt 2's improved serializer to fix edge cases of serializations like that one. The cost of patching FullSerializer in Bolt 1 couldn't be justified over other priorities, sorry!