The reason why everything reverted back to Health is

@sampattuzzi in case you haven’t figured it out already, the reason the stats all reverted to Health, as discovered near the end of the video, is because earlier you changed the TraitBonus field stats to stat and didn’t add a FormerlySerializedAs attribute to link the new serialization name with the old one, so Unity treated it as a new field and set it to the default value (Health).

This is one of my bugbears about Unity in that it’s possible to break things like this without any kind of warning.

1 Like

Good catch. Some code editors (I use JetBrains Rider) will automatically prompt you to add the [FormerlySerializedAs] attribute.

1 Like

Yep, I use Rider too, an excellent tool. None of that cut/paste-into-namespace nonsense either :slight_smile:

Worth every cent. Except the commercial price is ridiculous. Thankfully this is just a hobby for me so I can get away with the Personal version.

1 Like

I wish students would let me use Rider.


Privacy & Terms