(1.3b2) Unapplied prefab variable changes do not serialize/deserialize correctly

Reality.Stop() 4 years ago updated by Lazlo Bonin (Lead Developer) 4 years ago 3

(Originally found by HyenaGames, and I was able to replicate the problem)

  • Create an empty game object in your scene.
  • Give it a variables component.
  • Create a variable (string or number).  Give it some value.  For instance: an int with the value of 3.
  • Make it a Prefab.
  • Modify the variable value in your instance in the scene to a different value but don't apply it, so it has a different custom value.
  • Play
  • Observe that the values are string-truncated by one character. "Scene1"->"Scene" or if it is a number 22->2

This works fine in 1.2.3, but fails in 1.3b2, and renders the Platformer tutorial impossible to complete.

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
Working on Fix

Will look into for v.1.3b3. I feel like it's a regression introduced from fixing the Undo bug.

Fixed in Beta

It was indeed a regression. Working around Unity's undo system is ridiculously complicated. I think I fixed it for all cases this time. 

In case you're wondering, here's what the entire Bolt undo method looks like now. Each of these lines took me hours of work to figure out! https://gist.github.com/lazlo-bonin/a85586dd37fdf7cf4971d93fa5d2f6f7