Why are my values disappearing when I hit play?

With Odin, it's possible to show members in the inspector that are not necessarily being serialized. This is an important feature in Odin that allows us to display arbitrary members in the inspector without being constrained by what's serialized. But this also means that just because it's shown in the inspector, it doesn't necessarily mean that it's being serialized. For instance, if you put a BoxGroup attribute on a private field, but forget to also put SerializeField on it, it will show up in the inspector, but the values will be lost when you hit play or change the scene because nothing is actually serializing it.

Here are some common examples that would cause values to go missing:

[ShowInInspector]
private GameObject someField; // This will be shown in the inspector but nothing is serializing it.
[TabGroup("SomeTab")] // All group attributes inherit from ShowInInspector.
private GameObject someField;  // This will be shown in the inspector but nothing is serializing it.

In both of these cases you need to also add the SerializeField attribute or make the member public in order for Unity to serialize it.

[SerializeField]
private GameObject someField; // This will be shown in the inspector, and it will also be serialized.
[TabGroup("SomeTab"), SerializeField]
public GameObject someField;  // This will be shown in the inspector, and it will also be serialized.

There are a lot of detailed examples here:
Why is Odin not serializing or showing my field or property.

And you can read more about the difference between OdinSerialize, SerializeField and ShowInInspector in our manual, here:
Serialize Anything.

Can I use Odin for its editors only, without using the serialization? Can I use Odin for its editors only, without using the serialization?
Can I use Odin to make inspectors for my own asset store plugins? Can I use Odin to make inspectors for my own asset store plugins?
Can I use Odin Inspector to create custom editor windows? Can I use Odin Inspector to create custom editor windows?
Does the serialization support Windows Store and UWP? Does the serialization support Windows Store and UWP?
How do I contact Sirenix to report bugs, suggest features, or in general? How do I contact Sirenix to report bugs, suggest features, or in general?
Does Odin support serialization of Unity object references? Does Odin support serialization of Unity object references?
Does Odin support interfaces? Does Odin support interfaces?
How can I add an image to the inspector? How can I add an image to the inspector?
Why isn’t Odin drawing the inspector for my script? Why isn’t Odin drawing the inspector for my script?
Why is Odin not serializing or showing my field or property? Why is Odin not serializing or showing my field or property?
How will Odin handle existing editors? How will Odin handle existing editors?
How can I make a list show one item per page? How can I make a list show one item per page?
Does Odin support cross scene references? Does Odin support cross scene references?
Can I disable or hide an inspector property in play mode, or vice versa? Can I disable or hide an inspector property in play mode, or vice versa?
Which platforms are supported by Odin? Which platforms are supported by Odin?
How easy is Odin to uninstall? How easy is Odin to uninstall?
How will Odin affect performance in the inspector? How will Odin affect performance in the inspector?
How can I make my data in Odin Editor Windows persistent? How can I make my data in Odin Editor Windows persistent?
Unity crashed, could this have something to do with Odin? Unity crashed, could this have something to do with Odin?
How can I show static fields and properties in the inspector? How can I show static fields and properties in the inspector?
Can I use Odin's serialization without inheriting from SerializedMonoBehaviour etc.? Can I use Odin's serialization without inheriting from SerializedMonoBehaviour etc.?
How fast is Odin's Serialization system? How fast is Odin's Serialization system?
How stable/reliable is Odin's serialization system? Can I safely use it in my project? How stable/reliable is Odin's serialization system? Can I safely use it in my project?
Is it possible to customize how the dictionary drawer draw its key-type using attributes? Is it possible to customize how the dictionary drawer draw its key-type using attributes?
How can I make an attribute that lets you drag elements unto a member to set its value? How can I make an attribute that lets you drag elements unto a member to set its value?
Can I write my own custom editor code using Odin? Can I write my own custom editor code using Odin?
Why is there a Serializable JSON Dictionary in my Odin Editor Window? Why is there a Serializable JSON Dictionary in my Odin Editor Window?
How can I rename a type without loosing data? How can I rename a type without loosing data?