Godot version: 2.1.6 (happens on 3.1 as well)
OS/device including version: Windows 10, 64-bit
Issue description: VisibilityEnabler2D does not work on instanced scenes
Steps to reproduce:
VisibilityEnabler2DDebugger -> Live Scene Tree.player1 -> character_container, and click AnimationPlayer or Particles2D. They are still active.Minimal reproduction project:
visibilityenabler2dbug.zip
https://github.com/godotengine/godot/blob/2.1/scene/2d/visibility_notifier_2d.cpp#L225
Found something
Might be a reason why it's skipped? I don't know the internals that much, just sifting through code
edit: I commented out those 2 lines, and re-compiled. Just tested and there are no negative side effects. But I have no idea what I'm doing with C++
This is clearly disabled by design. There's probably some reason behind this.
CC @reduz
iirc the design here is that visibility enabler is only meant to affect the root node of the scene it is in. not children. but this seems a bit, odd. especially since it checks node types separately, like animation player.
the design here is that visibility enabler is only meant to affect the root node of the scene it is in. not children.
I found it effects all the children of the root node it is in, recursively:
https://i.gyazo.com/63a2337e5f0c1ccd2702bee36bd9acb7.gif (which is a good thing)
Which made me wonder why an instanced scene is ignored :thinking:
I just ran into this problem cause I was curious why my character's Particles2D was not being disabled. So I dug deeper ;D
probably because otherwise the recusion just disables that entire branch of the tree. which kind of makes sense.
it might be worth revisiting the goal of the node, clarifying it, and changing implementation accordingly.
"disable all nodes within the scene i am located in." "including children scenes?"
Most helpful comment
https://github.com/godotengine/godot/blob/2.1/scene/2d/visibility_notifier_2d.cpp#L225
Found something
Might be a reason why it's skipped? I don't know the internals that much, just sifting through code
edit: I commented out those 2 lines, and re-compiled. Just tested and there are no negative side effects. But I have no idea what I'm doing with C++