Playing particle effect without serialize field

Hi Ladislav,

It’s great to see that you are challenging yourself. Unfortunately, the code is not formatted, so it is a bit difficult to read. I just focussed on your last code and formatted it for you. :slight_smile:

I understood your goal was to find ParticleSystem components on specific game objects via code. If I understood that correctly, your solution is how one would do that. Since components do not have any name, there is no other way to find something that does have a name, then look for the ParticleSystem.

If the DustTrail methods get executed multiple times during runtime, I would recommend to cache the reference to the ParticleSystems you found because the Find* methods in Unity are very slow and resource-intensive.

Did this help? :slight_smile:


See also: