VisibilityEnabler

Inherits: VisibilityNotifier < Spatial < Node < Object

Enables certain nodes only when visible.

Description

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

Note that VisibilityEnabler will not affect nodes added after scene initialization.

Properties

bool

freeze_bodies

true

bool

pause_animations

true

Methods

bool

is_enabler_enabled ( Enabler enabler ) const

void

set_enabler ( Enabler enabler, bool enabled )

Enumerations

enum Enabler:

  • ENABLER_PAUSE_ANIMATIONS = 0 --- This enabler will pause AnimationPlayer nodes.

  • ENABLER_FREEZE_BODIES = 1 --- This enabler will freeze RigidBody nodes.

  • ENABLER_MAX = 2 --- Represents the size of the Enabler enum.

Property Descriptions

  • bool freeze_bodies

Default

true

Setter

set_enabler(value)

Getter

is_enabler_enabled()

If true, RigidBody nodes will be paused.


  • bool pause_animations

Default

true

Setter

set_enabler(value)

Getter

is_enabler_enabled()

If true, AnimationPlayer nodes will be paused.

Method Descriptions

Returns whether the enabler identified by given Enabler constant is active.


Sets active state of the enabler identified by given Enabler constant.