Skip to content

GPUParticles2D Never Freed #1

Open

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.

Activity

  1. fred-eric-rieg commented on Oct 23, 2025

    @fred-eric-rieg

    Your final thought is on spot!

    To fix this issue the tooltipp of "finished" hints:
    This signal is never emitted when one_shot is disabled, as particles will be emitted and processed continuously.

    Setting checking the box on "one_shot" to on and in _ready() setting emitting = true will queue_free() the particles.

  2. fkjkkll commented on Dec 5, 2025

    @fkjkkll

    I alse notice the bug. I ask gpt, got the reason: Scene with a BulletParticles root will reparent root automaticaly by godot, I almost believed it!
    Then I found this issue, and notice the bullet_particle.gd script (I even didn't notice the little script)......thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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