Prefabs are no longer saving string property values

I’m having a weird issue where a property on a component, in a prefab, is not being fully saved when I exit the prefab.Below I’m showing what I typed with the prefab open…

…and below I show what results when I leave the prefab and go back to where it’s used (Left arrow in Hierarchy).

This appears to be happening for any “public string” field now, as I’ve tried adding new dummy components to test it. It’s also happening for string fields that previously worked.

It always takes a bit of the text, clipping it.

I’ve tried adding an OnValidate method to emit the value, and it correctly shows the value that I’ve edited. I’ve also tried adding an explicit [SerializeField], but it doesn’t change the result.

I have no idea what could be causing this. I restarted the editor but it did not help.


Example of component that fails:

public class DummyInformation : MonoBehaviour {
    public string text;
}

That sure sounds mysterious… I would reboot Unity, perhaps reimport all… try a blank project, etc.

maybe somehow the saving is deferred or something. Does it happen with auto-save (in prefab mode) turned off and manually saving the prefab?

Worth telling us what Unity version this is happening on.

How about the underlying asset data? Is that truncated too? Or is it merely the display that is chopped off?

Version:
2022.3.4f1.0.14531
Revision: 2022.3/staging 35713cd46cd7
Built: Wed, 21 Jun 2023 17:47:39 GMT
on Linux

I tried a new 2D URP Project and created a single prefab and the behaviour persists.

I tried editing the string, and saving, then closing Unity. Then checking the underlying asset the text is truncated in the saved file.

I’ll try upgrading, assuming there’s a newer LTS release.

I upgraded and the problem persists, in a clean new project. I’m not sure what I should do now, since basically it means I can’t modify text in the editor at all. :frowning:

2022.3.6f1.0.15644
Revision: 2022.3/staging b9e6e7e9fa2d
Built: Tue, 25 Jul 2023 15:03:37 GMT

The problem seems to happen with any field type, not just text. It also applies if I open the prefab directly and edit it. The final changes are not saved. For example, if I edit three fields, the first two will have their full values saved, and the final one will be truncated.

I’ve tried disabling auto-save and it appears to work correctly. If I try to exit, and choose to Save, or if I manually click the “Save” button, it saves all of the values. Turning back on auto-save causes the same truncation to happen. I guess I live without auto-save. :frowning:

Could you please file a bug report?