Skip to content

GPUParticles2D Never Freed #1

Description

@dmreichard

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions