In bullet_particles.gd, the finished signal is connected to the on_finished() method, where the particle system is then queued for deletion. However, this never executes. For some reason, the GPUParticles2D never emits the finished signal.
The workaround I did for now is to define a "dying" variable at the top of the class and initialize it to false, and then change the _physics_process code to:
func _physics_process(delta: float) -> void:
if target && is_instance_valid(target):
global_position = target.global_position
elif not dying:
dying = true
emitting = false
get_tree().create_timer(lifetime, false).timeout.connect(on_finished)
I believe the reason the finished signal doesn't get fired is due to the particle system not being one_shot at the beginning of its life, but I'm not 100% certain.
In bullet_particles.gd, the finished signal is connected to the on_finished() method, where the particle system is then queued for deletion. However, this never executes. For some reason, the GPUParticles2D never emits the finished signal.
The workaround I did for now is to define a "dying" variable at the top of the class and initialize it to false, and then change the _physics_process code to:
I believe the reason the finished signal doesn't get fired is due to the particle system not being one_shot at the beginning of its life, but I'm not 100% certain.