+1 vote

I have a destructible object and I want to create a Particles2D when it is destroyed which emits a few different debris sprites in every direction.

It's easy enough to create a Particles2D with spread = 180 and one custom texture, but how could I go about changing this texture for every particle that's emitted?

I know there's no built-in functionality to achieve this, but I am wondering if there's a hack?

in Engine by (1,571 points)

Can't you just make a second particle system with a different texture?

1 Answer

+2 votes

Inside the ParticleMaterial use Animation->Offset = 1 and Animation->OffsetRandom = 1, this will chose between all frames of your texture randomly. By leaving the AnimationSpeed at zero, it should basically yield what you want.

by (1,239 points)

This doesn't seem to work for me :(. Tried with GPU and CPU particles, animation speed doesn't seem to have any effect (animated texture is still animated). I tried setting animated texture fps to 0, but that causes all particles to be same.

I'm not sure if my answer is actually what the OP asked for, but for clarity I made an example project in Godot 3.1.1 Dropbox Link

What needs to be done is to define the number of frames for the texture inside the CanvasMaterial for the particle emitter (not in the particle material). I did everything else as described and it seems to work.

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.