Add a way to disable any node #4722
Replies: 2 comments 3 replies
-
The use case seems a bit contrived to me. I don't see why you'd need to do this after the process mode refactor has landed in 4.0.alpha. |
Beta Was this translation helpful? Give feedback.
-
As a workaround, could you add code to instantly destroy undesired nodes in _init()? (have not tested if this would actually work)
If the node doesn't exist in the game at all, then this will break regardless. The only way for this to not break is if the node does exist, but spawns in a 'paused' state of some kind. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problems:
When I create scenes I often experiment with nodes properties values (position, size etc).
So sometimes I just duplicate the node, set the old node visibility to false and then change some parameters for the new node.
Then I compare results, and delete the old node if the new one looks/works better.
But there are many cases when I can't easily use this approach, for example if there is a reference to the node by name like
onready var node =$path_to_the_node
, or if the node uses signals.I want the node to still be in the tree in the editor, but completely disabled, which means it will not exist in the game at all.
Sometimes I just want to quickly test how the game would behave if I remove some node from the editor.
I solve it deleting the node then run the game then when I close the game window I press Ctrl+z to undo the node deletion, but this is not handy.
Solution:
The idea is to have an option, for example a checkbox (in the node right-click context menu), pressing it the node would still be in the Scene Tree Editor, but completely disabled like it doesn't exists as a node, (including the tool mode I guess?).
That means $Node won't work and
get_children()
will not have disabled nodes in the children list.Beta Was this translation helpful? Give feedback.
All reactions