0 votes

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.

in Engine by (48 points)

1 Answer

+1 vote

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 setlifetime() that can be set to zero and may work in conjunction with setemitting() as described above.

Last one is setvisibilityaabb(false)

by (70 points)

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.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.