+1 vote

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.

in Engine by (1,859 points)

1 Answer

+1 vote
Best answer

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: https://docs.godotengine.org/en/3.1/tutorials/3d/vertex_animation/controlling_thousands_of_fish.html

by (28,744 points)
selected by

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

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.

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

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.