Up to date
This page is up to date for Godot
If you still find outdated information, please open an issue.
Automatically disables another node if not visible on screen.
VisibleOnScreenEnabler2D detects when it is visible on screen (just like VisibleOnScreenNotifier2D) and automatically enables or disables the target node. The target node is disabled when VisibleOnScreenEnabler2D is not visible on screen (including when CanvasItem.visible is
false), and enabled when the enabler is visible. The disabling is achieved by changing Node.process_mode.
EnableMode ENABLE_MODE_INHERIT =
Corresponds to Node.PROCESS_MODE_INHERIT.
EnableMode ENABLE_MODE_ALWAYS =
Corresponds to Node.PROCESS_MODE_ALWAYS.
EnableMode ENABLE_MODE_WHEN_PAUSED =
Corresponds to Node.PROCESS_MODE_WHEN_PAUSED.
EnableMode enable_mode =
NodePath enable_node_path =
The path to the target node, relative to the VisibleOnScreenEnabler2D. The target node is cached; it's only assigned when setting this property (if the VisibleOnScreenEnabler2D is inside scene tree) and every time the VisibleOnScreenEnabler2D enters the scene tree. If the path is invalid, nothing will happen.