Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Particles and Particles2D signal when finished #3963

Closed
AlexHolly opened this issue Mar 6, 2016 · 10 comments
Closed

Particles and Particles2D signal when finished #3963

AlexHolly opened this issue Mar 6, 2016 · 10 comments

Comments

@AlexHolly
Copy link
Contributor

http://godotengine.org/qa/883/how-to-remove-a-particle2d

@bojidar-bg
Copy link
Contributor

You want a signal or just auto-free?

@AlexHolly
Copy link
Contributor Author

Depends on the use case I think.

  1. Someone who wants to re-use that Particle Node doesn't want auto-free.
  2. In my case I need just auto-free.

A boolean would be nice but what is with someone who wants to play a sound on end or play another Particle?

@bojidar-bg
Copy link
Contributor

Well, with a "emission ended" signal, we can just particles.connect("emission_ended", particles, "queue_free") or even particles.connect("emission_ended", player, "queue_free"), so it is way more useful actually (note that you can connect those through the Node panel as well).

bojidar-bg added a commit to bojidar-bg/godot that referenced this issue Feb 25, 2017
(Also remove some Particles2D::testee method, which was unused)
Resolves godotengine#3963
@bojidar-bg
Copy link
Contributor

Reopening, as the above PR was reverted when GPU particles were added.

@bojidar-bg bojidar-bg reopened this Mar 24, 2018
@bojidar-bg bojidar-bg changed the title Particle2D queue_free on end of animation Particles and Particles2D signal when finished Mar 24, 2018
@coppolaemilio
Copy link
Member

coppolaemilio commented Aug 6, 2018

I was about to ask about this issue. Is there a way to autofree them? I have a one_shot particle eaverytime a bullet hits a wall, and I'm worried that they will never get free if I don't do it manually

@KoBeWi
Copy link
Member

KoBeWi commented May 19, 2019

A workaround is using a Timer.

@MatthewDLudwig
Copy link

MatthewDLudwig commented Aug 19, 2020

Why was this reverted with the addition of GPU particles?

Hmm upon looking around at the code, I guess my real question is what the final status of the original issue is. To me it seems:

Particles2D runs on GPU and so I didn't dive too deep there, doesn't look like it'd be able to detect the end but I'm not confident on that.
CPUParticles2D resets the active flag to false if looping isn't true which I think is fine instead of signals, though signals would be cleaner.

I didn't look into the 3D nodes, but I assume the situation is the same. Can anyone confirm this, and maybe we can close out the issue with an official solution for detecting particle emission end for the various emitters.

@KoBeWi
Copy link
Member

KoBeWi commented Aug 19, 2020

Because the particle system was rewritten.

Also this should probably go to godotengine/godot-proposals#815

@MatthewDLudwig
Copy link

Thanks for the link, seems it's already been suggested. If anyone finds themselves here when looking for the solution, you can show your support for this being added to 4.0 at godotengine/godot-proposals#815 (comment)

@KoBeWi
Copy link
Member

KoBeWi commented Aug 19, 2020

So I guess this can be closed in favor of the proposal.

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

No branches or pull requests

6 participants