0
\$\begingroup\$

Here's what I need but can't quite figure out:

I want a button on the Inspector of a particular node. When that button is clicked (during the editing, not when the game is running), I want to switch the editor to a different particular scene (or just open a new scene in a separate tab; either will do).

Is there a way for me to do it?

\$\endgroup\$
3
  • \$\begingroup\$ For what purpose do you need a new scene while running the game? Maybe what you need can be done with the debugger tab, which is quite powerful. I'm asking you this because I don't really understand what you need. In fact there's already a button ( imgur.com/HBU1jSu ) that generates a new scene -- that needs to be saved if you want to keep it -- but in the editor itself, not on the inspector of a particular node \$\endgroup\$
    – atrefeu
    Nov 14 '21 at 16:30
  • \$\begingroup\$ Are you sure you don't simply want to export a PackedScene (for example: export(PackedScene) var scene_file). It is possible modify how properties show up in the inspector panel with an addon, however it is not clear on what nodes or what scene you should open, and exporting a PackedScene seems to do it already (you export the PackedScene from the node you want, and set it to the scene you want to open). \$\endgroup\$
    – Theraot
    Nov 14 '21 at 22:04
  • \$\begingroup\$ Rather than using tool, if you want to add new functionality to the editor, you might use the EditorPlugin functions. It's easy to instance a different Scene in the current tree, but I strongly doubt you can just open a scene in a new tab: you may simply use the Scene name and filter it in the resource search bar instead. \$\endgroup\$
    – liggiorgio
    Nov 18 '21 at 11:57

You must log in to answer this question.

Browse other questions tagged .