Regarding off-camera particle emision

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By pflat

Greetings everyone,

I’m delving in Godot and finding it an extremely rewarding experience.
I’m now facing a detail (can’t really call it a problem) that got me very curious.

In a 3D space I have 2 ships. When they are flying, I have a particle effect emitting particles (out of the engine). When they stop, the particle emitter stops emitting.
What’s nagging me happens in the following scenario: if one ship stops moving when it is off-camera, the particle emitter stops emitting. But, when the camera focus on the ship again, no matter how much time has passed, I still see the last particles emitted (the ones that were already created when the emission stoped).
I can avoid this if I make the particle AABB large enough to encompass the camera. But I’d like to change the camera between so large distances (even space sectors) that I don’t know if that is a good solution.
I only have one camera. I just move it in the node tree, in order to show diferent areas.

I wanted to attach a demo project to show what I explained. Can I do that? How do I do that?

So, do you think i’m doing it wrong? Is this something unavoidable?

Thanks in advance.

:bust_in_silhouette: Reply From: GarrettGemini

I’ve never run into this exact problem (yet), but a couple of guesses, or things I might try anyway.

I imagine you are using set_emitting(false)

I wonder if set_amount( 0 ) would work better, or maybe just before turning off the amount goes to zero, then just before turning on it goes back to your desired amount.

There is also a set_lifetime() that can be set to zero and may work in conjunction with set_emitting() as described above.

Last one is set_visibility_aabb(false)

Thanks for you time.
Yes, I’m using set_emitting(bool) to start/top the particle emission. I’ve tried messing with the amount and the lifetime parameters to no success.

The last suggestion gave me hope. Maybe its’ possible to disable visibiltyAABB, but I can’t pass boolean as a parameter, only a valid AABB.
If I pass an visibilityAABB that covers the hole game world, it works fine, but I’m reluctant to do that.

Oh well, it’s no big deal.
Thanks again.

pflat | 2018-05-13 06:43