Set Editable Children via script

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By arbo

I’ve looked around the docs and haven’t found anything but is there a way I can set a node’s “editable children” property via a script (specifically GDScript)? I have a prefab for a spawn point that requires manually places Area2Ds to trigger it and it’s a little tedious to also manually set editable children every time I add one to the scene. I’m hoping to set editable children inside the enter_tree() function.

:bust_in_silhouette: Reply From: IceExplosive

In _ready() of the node that you want to have editable children, call this… was just looking for it as well.

get_parent().set_editable_instance(self, true);

When trying your solution in a tool script in Godot 3.4.4 I get the following error message: Invalid call. Nonexistent function 'set_editable_instance' in base 'Node'.

Abstraction Mage | 2022-04-25 20:32