GPUParticles2D emits particles with random scale and only one at a time, not supposed to

Godot Version

4.5.1 stable Windows 11

Question

I have a GPUParticles2D node, and I’ve used the emit_particle() function for the purposes of emitting a set amount of particles everytime a certain event happens. But I’ve encountered two problems.

First, even though the scale_min and scale_max properties of the ParticleProcessMaterial are both set to 4.0, emitted particles sometimes are narrow, and sometimes are small in both axes, seemingly at random.

Secondly, even though I’m using emit_particle() which is supposed to emit a particle no matter the state of the GPUParticles2D, it is only emitting a single particle at a time, and will never emit another particle until the last one is gone.

What settings could be causing these problems? Particles in Godot are so confusing to me, and the documentation isn’t very clear to me.

Can you post your code? Depending on the flags you pass to the method some values will be overridden.

graze_particles.emit_particle(Transform2D(), Vector2(0,0), Color(1.0,1.0,1.0,1), Color(0.0,0.0,1.0,3.0), 0)

You need to pass the correct EmitFlags or it won’t work. You are passing 0 which isn’t a correct flag.

I tried changing it to every possible EmitFlag. 1 made the particles spawn somewhere I couldn’t see, 2 changed nothing, 4 made the particles stationary, 8 changed nothing, and 16 changed nothing.

They are flags so you need to merge them. For example, if you want to change the position and custom it would be GPUParticles2D.EMIT_FLAG_POSITION | GPUParticles2D.EMIT_FLAG_CUSTOM

I changed the flags to GPUParticles2D.EMIT_FLAG_ROTATION_SCALE | GPUParticles2D.EMIT_FLAG_VELOCITY and it seems to have solved the random scale issue, but the one-at-a-time issue is still present.

You need to have enough particles in the buffer for them to be emitted. Try increasing the GPUParticles2D.amount

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.