Delete GameObjects from scene in editor (not during play)

I cannot seem to find how to remove a GameObject from a scene that is currently being edited.
I am creating an editor menu that helps manage scene objects and need to replicate what happens when you right click a GameObject in the scene and select Delete.

Destroy seems to be related to objects at runtime, and does not work.

Any help is much appreciated.

Does DestroyImmediate work?

2 Likes

DestroyImmediate did the trick.

Thank you for the help @PraetorBlue