I am developing a side scroller game.
I need to disable obstacles to check interaction of character with outer bounds (walls) of the map but I couldn't find a way to make physics engine ignore obstacle nodes. When I make obstacles invisible I just get "scary invisible obstacles" :smile:
I have to remove them and add them back for now. Adding an icon to "disable nodes" like making them invisible will help. This will speed up manual debugging and testing.
Change the physics layer of said objects, or toggle the trigger flag
I unticked all obstacles monitoring property one by one and it worked, thanks for the hint.
But I was imagining single click way to achieve this. I put all obstacles as instanced scenes under a Node2D named 'obstacles'. I want to have a way to make 'obstacles' node 'disabled', thus exclude it and all of its children from game temporarily. Is this possible?
It is a single click way to achieve this:
I dont think there is a way to do that with a parent node. But you can select multiple nodes of the same node type and do it all at once
Only thing left is bullets for now. Some obstacles also shot bullets. I instance them by code in the 'shotter' obstacle. Even I tick editable children I am unable to select them, so I have to open main bullet scene and disable all bullets in the game. Not a big problem. So I don't think this feature is an important addition any more.
But if implemented, it will be useful anyway I think. So leaving open for now.
Fell free to close If you think otherwise.
@hubbyist if the bullet scenes are instanced by code, you can change values before adding the instances to the tree, there is no way to do that by "clicking" things that do not exist.
I was thinking a way to cut the branch that is producing them temporarily by clicking, as if they are erased from scene. (No parent no bullet) Thus I can test a temporary version of the scene without that branch. Then click again to rebind that branch, as if I paste them back to scene.
In other words think as if I open tscn file, comment out (if posibile) all code about that branch and save. then test scene. Open scene uncomment code about that branch. and test again. If automating this theoretical work follow is possible this may be useful I think.
But any way current capabilities of godot is good enough to achieve what I want as @nunodonato told. So this is a small issue that may be fixed in the far future.
@hubbyist if your "bullet generator" is an instanced scene, you can turn it into a placeholder in the scene tree (I think the InstancePlaceholder could be improved too #8428 ).
I think the initial proposal makes sense, a way to completely disable a node (and its children) as if it had been plainly deleted would be nice. Obviously in such a scenario deleting the node is not wanted, as you want to keep the node's configuration, just disable it temporarily for testing.
Can @Zylann https://github.com/godotengine/godot/issues/12453#issuecomment-340201230 proposal be solution to this issue as well?
I wish there was a way to disable nodes so I could figure out which node is crashing my app.
Disabling a node would be basically removing it from scene tree. And the disable could literally do that and store the node in some stash inside its parent, so it's visible in editor tree, but doesn't exist. Just writing this as potential solution, in case someone is looking for one.
Expanding the "InstancePlaceholder" to work on any node (not just scenes) may be enough for most cases.
May a [pr welcome] label be usefull for this issue?
Agree, this would be helpful. Myself I want to temporarily disable some scripts on a few nodes. I've spent a while already looking for a good way to do this but there doesn't seem to be much out there that isn't tedious or (ironically) time-consuming - if there is, it's certainly not in plain sight. (unless if I'm just a doofus, heh.) Imo having one simple + quick way to entirely disable a node rather than needing to look for workarounds for individual cases such as OP's and mine would help a lot.
Also - I imagine it could be easy to get confused if for example you hide a node you don't need (I initially though hiding nodes might disable them), forget about it, and then later come to realise that some strange bug had been caused by that node still affecting the scene due to it not totally being disabled. Having an option to disable the node as well as the option to hide it would help to prevent something like this from happening.
Are there any current plans to add this in any future versions of Godot? Interest in this issue seems to have died out.
I'll close this in favor of https://github.com/godotengine/godot-proposals/issues/370, as feature proposals are now tracked on the Godot proposals repository.
Most helpful comment
I think the initial proposal makes sense, a way to completely disable a node (and its children) as if it had been plainly deleted would be nice. Obviously in such a scenario deleting the node is not wanted, as you want to keep the node's configuration, just disable it temporarily for testing.