Is it possible to hide a member variable from being listed as an Override in the inspector?
In our project we have values in a MonoBehaviour that is automatically generated and set in the OnValidate() callback. This value is set and checked when the object is placed in a scene, but set to empty when in the context of a prefab. This value is used as a type of unique identifier in the context of a scene, but because multiple instances of the prefab can exist in the same scene, the value has no meaning in the context of being a prefab.
This system works well for our needs, but these values are, as expected, detected and listed as overriden in the inspector. This never being relevant to the end user i wish for the ability to hide it in this listing. Anyone know of a method to achieve this? My prefered solution would be some kind of Attribute that i could assign to a member.
I am not totally sure if I understood your issue, are you maybe talking about HideInInspector?
https://docs.unity3d.com/ScriptReference/HideInInspector.html
While HideInInspector hides the member value from the inspector itself, it doesn't effect the listing in the Overrides value dropdown, which is what i want to control.
Your answer
![](https://koobas.hobune.stream/wayback/20220613021628im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Destroy components sequentially if it has Required Component Attribute 0 Answers
How to create texture at runtime (Without using TextureImporter)? 1 Answer
Serialize a class that inherits MonoBehaviour 0 Answers
Start() and Awake() not called on MonoBehaviour 1 Answer
"Can't add script behaviour AICharacterControl. The script needs to derive from MonoBehaviour!" ? 0 Answers