Serializing simple types#

Check the type is correct.#

Hover over the type in your IDE to find the namespace1, then check the documentation to make sure its namespace is identical. Common improperly referenced namespaces include: System, System.Numerics, and UnityEngine.UIElements. If you referenced one of these namespaces and do not understand why, it's likely the first place to look!

You can always resolve namespaces by manually specifying them when you use a type, or by specifying names in the using block. For example:

using Object = UnityEngine.Object;

Check you are editing the inspected object.#

Are you sure the inspected object is the type that contains the variable you are declaring? 👀 Check that your Component or Scriptable Object is the same.

Using your IDE's go to definition2 feature should make it clear what type is actually being exposed.

  1. If your IDE is not showing this information, make sure it is properly configured.

  2. Visual Studio, VS Code, JetBrains Rider.