0 votes

Here's the thing. I have an object that constantly emits particles. At some point in my game I want to hide the object (with particles as well) which I do by setting its modulate.a (alpha) to 0. (I'm using Godot 3.0). After some time I want to make the object visible again and I do it by setting modulate.a to 1.

The problem is that the particles stayed in the same state they were when I hid the object.

I tried setting the alpha to 0.01 which works fine, but the object is still barely visible in some scenarios.

My guess is that particles system (and probably everything else) freezez when not visible. How do I disable this freezing/pausing?

asked Dec 31, 2017 in Engine by wingedadventurer (18 points)

Modulate.a pauses the emitter too? that is interesting (maybe a feature?)

Try changing the particles material color instead of the emitter.

How do I do that? I've tried to access the material, but Godot doesn't seem to find it (it prints that process_material property is null even though it's set to ParticlesMaterial).

I have tried and can do $Particles2D_node.process_material.color.a = 0

I have just tried that, but it does nothing. When I manually navigate, I notice that Particles2D node has a "process_material.color" property, but it's not actually a color. It's a Color Ramp and I don't believe that can be manipulated in the way I want.

I do not know what may be happening there then because I can use color normally.

Maybe you can post more details about your particles setup.

I actually tested your proposition in new project and it worked! Now I've checked my code better and realized I made a stupid mistake -- because I've messed with Color Ramp thing, I've accidentally created one that was overriding any color settings!

Now that it's fixed, what you said actually works, the emitting doesn't freeze. Thank you!

2 Answers

0 votes

As user eons proposed, the answer was to access Particles2D's Process Material and set the alpha color of that material to 0, like this:

MyParticle.process_material.color.a = 0

This will not freeze the emitter. Thanks, eons!

answered Jan 1, 2018 by wingedadventurer (18 points)
0 votes

I couldn't disable pausing on the particles, but solved this by using restart() when re-enabling visibility on the parent object:

func reveal():
answered Dec 27, 2018 by raeynn (14 points)
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.