-
-
Notifications
You must be signed in to change notification settings - Fork 19.7k
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
Particles3D: OneShot and Explosiveness dont work correctly #26042
Comments
Please explain what were you expecting and how the results differ from that. A full explanation helps people understand your problem. Right now, everything looks correct in the gif you posted, so it is difficult to tell what needs to be fixed, if anything. |
When i play animation it should emit 2 times, but it emits sometimes one, sometimes nothing, it is very undeterminates. |
When set |
I think what might be happening is all the particles are being emitted in the first shot, and so there's nothing to emit in the next shot. With a value of 8 particles and an explosive value of 0.8, it seems likely that all 8 particles would be fired within the time frame between first emission and the next emission, and since they haven't died before the next emission is triggered, the emitter emits nothing. The amount value isn't how many will be emitted each frame, but more the target amount the emitter will try to create over time, based on the lifetime of the particles. I don't fully understand it, but that seems to be roughly how it works. |
@sketchyfun. Yea, thats more or less whats going on. Except setting "Emitting" off and on doesnt create another "shot". The shot refers to the lifetime. The "one shot" ends at the end of the particles life, not when "Emitting" is toggled. Even though "Emitting" is turned off, the particles are still running. Turning "Emitting" off and on doesnt reset the particles. The lifetime is still 1 so the particles dont reset until 1 second has passed. An explosiveness of 0.8 means that all particles are emitted within 0.2 seconds (because the lifetime is 1). So what you are seeing is the particles being emitted in a continuous stream for 0.2 seconds and then turning "Emitting" off and on does nothing because nothing would be emitted anyway. When explosiveness is 0 the particles emit continuously so you turning "Emitting" on and off actually impacts whether the particles are emitted or not. I hope that clears things up. This is not a bug, just a misunderstanding. |
Unfortunately this is also how I setup a lof of particles systems, so I have experienced the same issue many times (We are mainly working with CPUParticles and CPUParticles2D). I also use One shot and explosiveness and then start them using the AnimationPlayer. I think we could get better results if we had a "reset particles" that simply kills all particles. Then when you set emitting true it should start from the beginning. In Unity they have a "Stop" and a "Simulate" button. |
@jesperkondrup What do you think about adding a bool CC @JFonS I would appreciate your thoughts as well Sample implementation in CPUParticles: restart_on_emitting.txt |
@clayjohn That sounds like a good idea, as long as it's also working when you start it from an AnimationPlayer. |
@jesperkondrup Actually I think the solution to this will be to solve #27146 Emitting should be able to turn on and off without restarting the particle simulation. My proposed solution was to turn this behaviour on and off with a bool. However, I think a proper solution is to fix the bug with |
Closing as fixed by #29974 I understand the workflow with animations is still not ideal as animations won't call methods in editor. However, that is not something that should be fixed in particles. It is something that should be addressed within the animation player. |
Godot version:
Godot 3.1 commit 29fd942
OS/device including version:
Windows 10
Issue description:
![2019-02-19_11-21-17](https://user-images.githubusercontent.com/3992195/52990137-4fe99880-3439-11e9-809d-8d532fb0ffe2.gif)
Particles3D dont work as expected when set
one shot
andexplosiveness > 0
I have created a simple scene with Animation Player that start/stop emitting particles
Minimal reproduction project:
godot_particles_bug.zip
The text was updated successfully, but these errors were encountered: