Only One header shows up in the inspector while I have two. Both of them have public variable under it.
Like @ntgCleaner correctly said: The next variable after the header needs to be one that shows up in the inspector (needs to be public or a SerializeField).
Everything after is an attribute that gets used for the following variable. If the variable is private or not Serializable in general, your header won’t show up.
Fixes are:
- make the following variable public (not recommended)
- keep the variable private but make it Serializable (see code below)
- change the order of your variables and have a public variable (or SerializeField) as your next variable (recommended)
Info: A Serializable variable shows up (and can be changed in the inspector), while still being private and not accessible from other scripts.
Example:
[SerializeField] private bool isGrounded;
This happened to me too. I’m not sure exactly the fix, but I was having an issue when the next variable after a header was private. I put the header over a public variable (or serializefield) and it worked after that.