godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.1k stars 21.18k forks source link

Cpuparticles keeps its "emitting" property true even though it is not emitting particles. #63618

Open Torguen opened 2 years ago

Torguen commented 2 years ago

Godot version

v3.5.rc8.official [516d6b6ba]

System information

win10 64

Issue description

In short: The "emitting" property is still activated even though new particles are no longer being generated.

With the "Explosiveness" property set to high, in my case set to 1. The "CPUParticles" particle node has a "one shot" property. When you activate that property then the "emitting" property is automatically activated, so far ok. What can't be/I don't see the point/I don't think it should work this way is that the "emitting" property remains activated even when all the particles have already been generated. Make no mistake, that "emitting" property is still on even though the generator is no longer generating new particles. That doesn't make sense, if "one shot" is on, "emitting" should take into account the "explosiveness" parameter and then it should only stay on while new particles are being generated. This problem prevents activating "emitting" again to produce a new explosion of particles. That is, you cannot activate the generator again until "emitting" has been set to false. You won't be able to do two bursts very quickly.

This causes me the problem in my project of not being able to generate two particle explosions without a good amount of time between them.

https://youtu.be/QUIpVeW09xI

Steps to reproduce

See the video

Minimal reproduction project

...

Calinou commented 2 years ago

Related to https://github.com/godotengine/godot/issues/17903.

When oneshot is enabled, the emitting property is only disabled after lifetime * 1.2 seconds have passed. This is done by design.

Torguen commented 2 years ago

I'm not sure if the problem is related.

Let's see, this code doesn't work because of the problem reported in this thread.

Captura

This code makes the particle generator emit an explosion of particles every 0.2 seconds but not work becasuse there is something weird going on out there that prevents it. It is that internal behavior that the generator has. Emitting means emitting, but it doesn't behave like that because emitting is still active even though it's not emitting. This is a huge limitation for the generator. You cannot spawn explosions every 0.x~1.x seconds.

I guess there is no solution to this. If cpuparticles' "one_shoot" is meant to do this sort of thing, then this code should work. testsVarios.zip