I have a scene called MyThing, which has a gd script with a class_name of MyThing that is set as @tool. In there is an @export var called MyThingNeighbours, which is an array of type MyThing.

In the Editor, I have a level with many MyThing(s) instantiated and Id like to pick one and add others to its array MyThingNeighbours.
This works, but I have to pick from a slide of Select A Node, and its very hard to work out which instance of MyThing I'd like to pick.

I was hoping there was a way I could expose the Picker (I think its called?). So I could click 'add neighbour' to my array, and the curosr turns into Picker (or Pen ?) and I can select via the actual scene which MyThing I want to add.
Is this possible? If so, what do I need to add to my code.

I hope that makes sense !

  • xyz replied to this.

    icecreamant Afaik something like this cannot be done out of the box. However, you can develop an editor plugin that does what you need. It's a bit involved but if having this would greatly improve your workflow then making a plugin would pay off.

    There's a also a lightweight solution you may want to start with instead of a full blown plugin. It's less elegant but it may be sufficient for your needs. Make an editor script (which runs on demand) and in it, get the current selection and append this selection into the target array. If the target node also needs to be specified - let it be the last (or first) object in the selection list, so the appending code knows where in the selection to find the target node.

    The whole thing boils down to several lines of code placed into editor script's _run() method. The usage then would look something like this: select all nodes you need to add to the array, select the node containing the array, run the editor script.