I have a motor script that allows me to change the values of the attached collider. I want to disable editing the collider component in the inspector completely so that only my motor script can change the values in the inspector. How can I achieve this?
1 Like
I haven’t actually ever tried this but it should actually work:
void Reset()
{
this.hideFlags = HideFlags.NotEditable;
}
Note that this would only work for newly attached components of that type when attached in the editor or when you rightclick on an existing component and choose “Reset”. If you want to attach this script during runtime you might want to add this line also to the Awake method.