I am very new to Godot with almost zero prior programming knowledge. I would like to have 3 separate Particle2D nodes that each independently have their textures randomly chosen from a small list.
I have tried creating 3 separate arrays, but I’m not sure how to tell pick_random() to choose from a specific array, or how I would have those randomly chosen values correspond to the textures of the particles.
I have also considered the method of creating several more Particle2D nodes and enabling and disabling them as needed, but I’m not sure how to do that either and it seems incredibly enefficient.
I don’t think you need 3 arrays, one shared list works because each time you call pick_random() it makes a fresh independent pick. Calling it three times can give three different textures (or sometimes the same one twice, which is what random means).
Attach a script like this to a node that has your three particle nodes as children:
The @export line makes a Textures list show up in the Inspector when you select the node, so you can drag your images straight into it, no code needed to fill the list. Then swap Particles1/2/3 for your actual node names.