- Home /
Override Transform Inspector for specific GameObjects
I'm working on an editor solution that helps level designers position objects around a circle. All object positions are described by their angle and distance from the center point, which is then mapped to the actual world position internally.
It makes sense to move objects in that way in the editor as well instead of using the standard Cartesian Transform component. Therefore I replaced the Transform inspector with my own custom solution.
The CustomEditor(typeof(Transform)) works fine, but I'd actually wish I could further specify which types of objects have my custom Transform Inspector and which ones the default one.
Is there a way to have a custom Inspector for only those objects that also have a certain type of script attached or maybe via Tag? And then have all other objects use the default Transform Inspector?
Thanks! :)
Answer by Matt1000 · Mar 13, 2017 at 06:56 AM
It is pretty easy actually, you just need an if in your editor script. If the gameobject selected has a certain tag, name or script attached, use your methods. Else draw default inspector. All in the OnInspectorGUI (). ;D
Your answer
![](https://koobas.hobune.stream/wayback/20220613200757im_/https://answers.unity.com/themes/thub/images/avi.jpg)