With Odin, it's possible to show members in the inspector without them 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 is 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 the ShowInInspector 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.
If you run into these kinds of issues, then we highly recommend checking out the Serialization Debugger. This tool should give you an overview of your scripts, and tell you both why something is serialized, why it is not, and which serializer that is used.
You can find the Serialization Debugger under Tools > Odin Inspector > Serialization Debugger, or you can open it directly from the context menu of your MonoBehaviours.
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: