if (camera) { foreach (Transform transform inSelection.transforms) { Undo.RegisterUndo(transform, transform.name + " Looks at Main Camera" ); transform.LookAt(camera.transform); } } } //The menu item will be disabled if nothing, is selected. [MenuItem ("Example/Selection looks at Main Camera _l", true)] staticbool ValidateSelection () { returnSelection.transforms.Length != 0; } }