Save some trouble: "SelectionBase" attribute

Edit: ok, I see it’s done in the next section!

In addition to the [ExecuteInEditMode] attribute, you might want to also put the [SelectionBase] attribute on the script.

What this does is ensure that, when you click on your cube, it selects the game object that the script is on (namely, the parent), instead of one of the faces. If you really want to select a face, you just click again.

This is a real frustration saver if you, like me, tend to click on a child object unintentionally and then manipulate the child when you meant to manipulate the parent.

Privacy & Terms