VFXOneShot ​
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 ​
float | delay_start | 0.0 |
bool | follow_target_on_death | false |
Variables ​
Timer | delay_timer |
Methods ​
float | default_fade_in() |
float | default_fade_out() |
void | activate_vfx( selection: VFXSelection = null ) |
void | deactivate_vfx() |
void | attach_to_entity( target: Variant, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO ) |
void | spawn_at_position( pos: Vector3, new_rotation: Vector3 = Vector3.ZERO ) |
void | spawn_attached_to_entity( entity: Entity, location: VFXSelection.VfxLocation, offset: Vector3 = Vector3.ZERO ) |
void | force_start() |
bool | is_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