VisibilityEnabler

Inherits: VisibilityNotifier < Spatial < Node < Object

Category: Core

Brief Description

Enable certain nodes only when visible.

Member Functions

bool is_enabler_enabled ( int enabler ) const
void set_enabler ( int enabler, bool enabled )

Member Variables

  • bool freeze_bodies
  • bool pause_animations

Numeric Constants

  • ENABLER_FREEZE_BODIES = 1 — This enabler will freeze RigidBody nodes.
  • ENABLER_PAUSE_ANIMATIONS = 0 — This enabler will pause AnimationPlayer nodes.
  • ENABLER_MAX = 2

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.

Member Function Description

  • bool is_enabler_enabled ( int enabler ) const

Returns whether the specified enabler was set to true or not.

  • void set_enabler ( int enabler, bool enabled )

Set an enabler to true for all nodes of its type to be disabled when the VisibilityEnabler is not in view. See the constants for enablers and what they affect.