Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using UnityEditor;
using UnityEngine;
public class Question1_practical
[MenuItem("GameObject/Create Child Empty &#n", true)]
static bool Validate()
return Selection.activeTransform;
[MenuItem("GameObject/Create Child Empty &#n", false)]
static void Create()
GameObject child = new GameObject("child");
child.transform.parent = Selection.activeTransform;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment