How can I access the individual particles of a Particles3D system and manipulate their properties?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By johnygames

I need to gain access to all the particles of a Particles3D system so as to change their transform (translation, rotation, scale) and their material properties (colour, texture, animation frame etc.) via code. Is this possible in Godot? What methods do I have to use? Any info or tutorials are greatly appreciated.

:bust_in_silhouette: Reply From: Zylann

I think you can do that with CPUParticles due to them be simulated on the CPU. That makes them slower to render though.
If you use Particles, those run entirely on the GPU so you have to use a particles shader to control their simulation.

There is a tutorial about controlling particles in the doc: Controlling thousands of fish with Particles — Godot Engine (3.1) documentation in English

I was hoping I could avoid using shaders. Are you sure there is no other way to access Particles programmatically?

johnygames | 2019-12-16 20:21

Shaders are programs. They just run on the graphics card, so some communication via graphics primitives are being used.

But if you mean to set particles position from a script, I believe CPUParticles is meant for that.

Zylann | 2019-12-16 21:11

Thank you, I’ll give it a try. It’s just that I can’t wrap my head around the shader language.

johnygames | 2019-12-16 21:18