Enable certain nodes only when visible.
    public class VisibilityEnabler2D : VisibilityNotifier2D

The VisibilityEnabler2D will disable RigidBody2D, AnimationPlayer, and other nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler2D itself.

Inheritance Chain

Constructors

    public VisibilityEnabler2D()

Properties

    public bool FreezeBodies { get; set; }

If true, RigidBody2D nodes will be paused.

    public bool PauseAnimatedSprites { get; set; }

If true, AnimatedSprite nodes will be paused.

    public bool PauseAnimations { get; set; }

If true, AnimationPlayer nodes will be paused.

    public bool PauseParticles { get; set; }

If true, Particles2D nodes will be paused.

    public bool PhysicsProcessParent { get; set; }

If true, the parent’s Node._PhysicsProcess(float) will be stopped.

    public bool ProcessParent { get; set; }

If true, the parent’s Node._Process(float) will be stopped.

Methods

    public bool IsEnablerEnabled(Enabler enabler)

    public void SetEnabler(Enabler enabler, bool enabled)

Inner Types

Enabler

Name Value Description
PauseAnimations 0 This enabler will pause [AnimationPlayer] nodes.
FreezeBodies 1 This enabler will freeze [RigidBody2D] nodes.
PauseParticles 2 This enabler will stop [Particles2D] nodes.
ParentProcess 3 This enabler will stop the parent’s _process function.
ParentPhysicsProcess 4 This enabler will stop the parent’s _physics_process function.
PauseAnimatedSprites 5  
Max 6  
Tags: