Creating game object preset (not sure what its called)

Hi,

I’m not sure how to make a game object preset (one that’s under the GameObject section in the menu)

thanks

Use the [UnityEditor.MenuItem] attribute on an editor script method. Example: (although you should organize it better than this)

using UnityEngine;
using UnityEditor;

public static class TestMenuItem
{
    [MenuItem("GameObject/My Thing")]
    public static void CreateMyThing()
    {
        GameObject myThing = new GameObject("My Thing");
    }
}
1 Like