- Home /
Fold/Unfold inspector components through script
Is there a way to fold/unfold components by code? I want the collider component to be folded because I don't want the green edges of the collider to show up.
Thanks!
Alex
Answer by NanoEngine · Mar 24, 2017 at 08:23 PM
As far as I understand you want to "disable" the collider instead of "fold/unfold" it?
If that's the case this is what you need to do:
GetComponent<BoxCollider>().enabled = false;
No I most certainly want it to be unfolded for the following effect:
Can I ask you why you want to do that? Because as far as I know, since it does not affect the gameplay, I afraid that there is no code for it.
I'm writing a gizmo tool, it's not for a game :)
I indeed think that's the case, too bad :/
Your answer
![](https://koobas.hobune.stream/wayback/20220612113859im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Gizmo equivalent of Handles.DrawSolidArc? 0 Answers
Draw arbitrary stuff in level editor only 1 Answer
Gizmos at RunTime 1 Answer
Gizmos drawing units 1 Answer
Gizmos aren't working 1 Answer