Skip to content

VFXLoop ​

Inherits: VFX < Node3D

Inherited by: VFXEnchant, VFXWeather

Loop VFX - Continuous effects like auras, channeling, persistent buffs/debuffs Supports start/loop/end animation sequence Now supports duration override with graceful stop sequence

Variables ​

LoopStateloop_stateLoopState.STARTING
boolmanually_stoppedfalse
boolhas_start_animationfalse
boolhas_loop_animationfalse
boolhas_end_animationfalse

Methods ​

voidactivate_vfx( selection: VFXSelection = null )
voidstop_loop_vfx()
voidattach_to_entity( entity: Variant, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO )
voiddeactivate_vfx()
floatdefault_fade_in()
floatdefault_fade_out()
floatend_animation_length( effect: VFX, fallback: float ) static
voidspawn_at_position( pos: Vector3, new_rotation: Vector3 = Vector3.ZERO )
voidspawn_attached_to_entity( entity: Entity, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO )
boolis_fading()
boolis_looping()
boolis_ending()
voidforce_stop()
voidrestart_loop()
boolhas_duration_override()

Enumerations ​

enum LoopState ​

Animation state management

  • STARTING = 0
  • LOOPING = 1
  • ENDING = 2
  • FINISHED = 3

Variable descriptions ​

LoopState loop_state = LoopState.STARTING ​

Which part of the effect plays: starting, looping or ending.

bool manually_stopped = false ​

Track if we've been manually stopped

bool has_start_animation = false ​

Animation references

bool has_loop_animation = false ​

True when the effect has a loop animation.

bool has_end_animation = false ​

True when the effect has an end animation.

Method descriptions ​

void activate_vfx( selection: VFXSelection = null ) ​

Loop VFX should NOT auto-cleanup by default (manual control)

void stop_loop_vfx() ​

Manually stop the loop VFX (triggers end sequence)

void attach_to_entity( entity: Variant, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO ) ​

Attaches the effect to a place on an entity, with an offset.

void deactivate_vfx() ​

Ends the effect (it plays its end animation first).

float default_fade_in() ​

A loop fades in over 0.25 s

float default_fade_out() ​

A loop with an end animation fades out over that animation (both end together), without one over 0.35 s

float end_animation_length( effect: VFX, fallback: float ) ​

The length of the end animation of an effect (clamped to 0.1 to 3 s), or fallback when it has none

void spawn_at_position( pos: Vector3, new_rotation: Vector3 = Vector3.ZERO ) ​

Starts the effect at a position and a rotation.

void spawn_attached_to_entity( entity: Entity, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO ) ​

Starts the effect attached to an entity.

bool is_fading() ​

Is the effect fading out?

bool is_looping() ​

Is the effect in its loop part?

bool is_ending() ​

Is the effect in its end part?

void force_stop() ​

Stops the effect at once.

void restart_loop() ​

Starts the effect again from its start part.

bool has_duration_override() ​

Does the effect have a timer that sets how long it lasts?