Skip to content

VFXOneShot ​

Inherits: VFX < Node3D

OneShot VFX - Fire-and-forget effects like explosions, impacts, hits Can be positioned at a location or attached to entities Automatically finishes when animation/particles complete Base VFX class handles the autonomous behavior for OneShot types

Properties ​

floatdelay_start0.0
boolfollow_target_on_deathfalse

Variables ​

Timerdelay_timer

Methods ​

floatdefault_fade_in()
floatdefault_fade_out()
voidactivate_vfx( selection: VFXSelection = null )
voiddeactivate_vfx()
voidattach_to_entity( target: Variant, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO )
voidspawn_at_position( pos: Vector3, new_rotation: Vector3 = Vector3.ZERO )
voidspawn_attached_to_entity( entity: Entity, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO )
voidforce_start()
boolis_in_delay_phase()

Property descriptions ​

OneShot Settings

float delay_start = 0.0 ​

Optional delay before starting VFX

bool follow_target_on_death = false ​

Continue following even if target dies

Variable descriptions ​

Timer delay_timer ​

Delay timer for start delay

Method descriptions ​

float default_fade_in() ​

OneShot VFX should always auto-cleanup when finished A one shot comes in at once (a hit has its punch); cut short, it fades out over 0.15 s

float default_fade_out() ​

The fade out of the kind of effect (VFX: 0.2 s); a kind overrides it (from VFX)

void activate_vfx( selection: VFXSelection = null ) ​

Activate VFX from pool or fresh spawn (from VFX)

void deactivate_vfx() ​

Override to handle delay timer cleanup

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

Enhanced entity attachment for OneShot VFX

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

Spawn OneShot VFX at a world position

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

Spawn OneShot VFX attached to an entity

void force_start() ​

Force start (skip delay)

bool is_in_delay_phase() ​

Check if VFX is in delay phase