New gameobject to spawn in front of editor camera?,

Right now when I click on menu “Composer Suite/Speaker” it will spawn the scripts components at the default location making it hard to find and time consuming to set up where I need it in the scene.

I just want it to spawn in front of the editor camera so I can set the scene up quicker!
I’m very new to all of this, I would love for some help!

Thank you :slight_smile:

using UnityEditor;
using UnityEngine;

public class SpeakerBoxS
    [MenuItem("Composer Suite/Speaker")]
    static void Create()
        for (int x = 0; x != 1; x++)
            GameObject go = new GameObject("Speaker Box");
            go.transform.position = new Vector3(x, 0, 0);


The editor camera is usually Camera.current when called from the editor. You can use its transform property to get a Vector3 right in front of it. Something like

Camera.current.transform.TransformPoint(Vector3.forward * DistanceFromCamera);